Skip to content

Commit 38a324b

Browse files
committed
Add packaging files (requirements, readme, ...)
1 parent 5079dbc commit 38a324b

File tree

5 files changed

+112
-1
lines changed

5 files changed

+112
-1
lines changed

LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The MIT License
2+
3+
Copyright (c) 2016 OpenFoodFacts, Inc. http://openfoodfacts.org
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORG
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
23+

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
# openfoodfacts-python
1+
# Open Food Facts client for your python scripts
2+
3+
4+
### install
5+
6+
7+
sudo pip install git+https://github.com/frankrousseau/openfoodfacts
8+
9+
or:
10+
11+
git clone https://github.com/frankrousseau/openfoodfacts
12+
cd openfoodfacts
13+
sudo python setup.py install
14+
15+
16+
### Docs
17+
18+
*Get all available trace types*
19+
20+
```python
21+
traces = openfoodfacts.get_traces()
22+
```

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests==2.11.1

requirements_test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests_mock==1.0.0

setup.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
import re
5+
import sys
6+
7+
from setuptools import setup
8+
from setuptools.command.test import test as TestCommand
9+
10+
11+
if sys.argv[-1] == 'publish':
12+
os.system('python setup.py sdist upload')
13+
sys.exit()
14+
15+
packages = [
16+
'openfoodfacts',
17+
]
18+
19+
requires = open('requirements.txt').read().split('\n')
20+
test_requirements = open('requirements_test.txt').read().split('\n')
21+
22+
with open('openfoodfacts/__init__.py', 'r') as fd:
23+
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
24+
fd.read(), re.MULTILINE).group(1)
25+
26+
if not version:
27+
raise RuntimeError('Cannot find version information')
28+
29+
with open('README.md', 'r') as f:
30+
readme = f.read()
31+
32+
setup(
33+
name='openfoodfacts',
34+
version=version,
35+
description='Easy querying of OpenFoodFacts.',
36+
long_description=readme,
37+
author='Pierre Slamich',
38+
author_email='[email protected]',
39+
url='http://openfoodfacts.org',
40+
packages=packages,
41+
package_data={'': ['LICENSE']},
42+
package_dir={'hungergame': 'hungergame'},
43+
include_package_data=True,
44+
install_requires=requires,
45+
license='Apache 2.0',
46+
zip_safe=False,
47+
classifiers=(
48+
'Development Status :: 5 - Production/Stable',
49+
'Intended Audience :: Developers',
50+
'Natural Language :: English', 'License :: OSI Approved :: Apache Software License',
51+
'Programming Language :: Python',
52+
'Programming Language :: Python :: 2.6',
53+
'Programming Language :: Python :: 2.7',
54+
'Programming Language :: Python :: 3',
55+
'Programming Language :: Python :: 3.3',
56+
'Programming Language :: Python :: 3.4',
57+
'Programming Language :: Python :: 3.5',
58+
'Programming Language :: Python :: Implementation :: CPython',
59+
'Programming Language :: Python :: Implementation :: PyPy'
60+
),
61+
test_suite='tests',
62+
tests_require=test_requirements,
63+
extras_require={
64+
},
65+
)

0 commit comments

Comments
 (0)