This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from SafetyCulture/INTG-539-pip_install
INTG-539 pip install
- Loading branch information
Showing
47 changed files
with
313 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include README.md | ||
include tools/exporter/ReadMe.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# safetypy (SafetyCulture Python SDK) | ||
|
||
Python SDK for interacting with the SafetyCulture API | ||
|
||
Supports [Python 2](https://www.python.org/downloads/mac-osx/). | ||
This SDK is not compatible with Python 3. | ||
|
||
|
||
## Installation | ||
You will need to have [Python](https://www.python.org/downloads/) and [Pip](https://pip.pypa.io/en/stable/installing/) installed on your computer. | ||
|
||
Then run: | ||
``` | ||
pip install safetyculture-sdk-python | ||
``` | ||
|
||
This will install | ||
* SafetyCulture Python SDK | ||
* iAuditor Exporter Tool | ||
* README files | ||
|
||
### Basic Usage of the SafetyCulture Python SDK | ||
1. Import `safetypy` into a Python module or Python interpreter: | ||
``` | ||
import safetypy | ||
``` | ||
2. Create an instance of the SafetyCulture class: | ||
``` | ||
sc = safetypy.SafetyCulture(YOUR_IAUDITOR_API_TOKEN) | ||
``` | ||
#### For more information regarding the Python SDK functionality | ||
1. To open the Python interpreter, run | ||
``` | ||
python | ||
``` | ||
2. From the Python interpreter, import the Python SDK by running | ||
``` | ||
import safetypy | ||
``` | ||
3. For an overview of available functionality, run | ||
``` | ||
help(safetypy.SafetyCulture) | ||
``` | ||
|
||
### Audit Exporter Tool | ||
See [here](https://github.com/SafetyCulture/safetyculture-sdk-python/blob/master/tools/exporter/README.md) for a complete guide on the audit exporter tool. | ||
|
||
## License | ||
|
||
Copyright 2017 SafetyCulture Pty Ltd | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .safetypy import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from setuptools import setup | ||
|
||
setup(name = 'safetyculture-sdk-python', | ||
version = '2.0.2', | ||
description = 'SafetyCulture Python SDK and iAuditor integration tools', | ||
url = 'https://github.com/SafetyCulture/safetyculture-sdk-python', | ||
author = 'SafetyCulture', | ||
author_email = '[email protected]', | ||
include_package_data=True, | ||
packages = ['safetypy', 'tools', 'tools/exporter'], | ||
entry_points = { | ||
'console_scripts': [ | ||
'iauditor_exporter = tools.exporter.exporter:main', | ||
], | ||
}, | ||
long_description=open('README.md', 'r').read(), | ||
install_requires = [ | ||
'python-dateutil>=2.5.0', | ||
'pytz>=2015.7', | ||
'tzlocal>=1.3', | ||
'unicodecsv>=0.14.1', | ||
'requests>=2.10.0', | ||
'pyyaml>=3.11' | ||
], | ||
python_requires = "!=3.*" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .exporter import csvExporter | ||
from .exporter import exporter | ||
|
Oops, something went wrong.