Browse Source

initial commit

Médéric Hurier 4 months ago
commit
836e561b57

+ 170
- 0
LICENSE.txt View File

@@ -0,0 +1,170 @@
1
+EUROPEAN UNION PUBLIC LICENCE v. 1.2 
2
+EUPL © the European Union 2007, 2016 
3
+
4
+This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined below) which is provided under the 
5
+terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such 
6
+use is covered by a right of the copyright holder of the Work). 
7
+The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following 
8
+notice immediately following the copyright notice for the Work: 
9
+                          Licensed under the EUPL 
10
+or has expressed by any other means his willingness to license under the EUPL. 
11
+
12
+1.Definitions 
13
+In this Licence, the following terms have the following meaning: 
14
+— ‘The Licence’:this Licence. 
15
+— ‘The Original Work’:the work or software distributed or communicated by the Licensor under this Licence, available 
16
+as Source Code and also as Executable Code as the case may be. 
17
+— ‘Derivative Works’:the works or software that could be created by the Licensee, based upon the Original Work or 
18
+modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work 
19
+required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in 
20
+the country mentioned in Article 15. 
21
+— ‘The Work’:the Original Work or its Derivative Works. 
22
+— ‘The Source Code’:the human-readable form of the Work which is the most convenient for people to study and 
23
+modify. 
24
+— ‘The Executable Code’:any code which has generally been compiled and which is meant to be interpreted by 
25
+a computer as a program. 
26
+— ‘The Licensor’:the natural or legal person that distributes or communicates the Work under the Licence. 
27
+— ‘Contributor(s)’:any natural or legal person who modifies the Work under the Licence, or otherwise contributes to 
28
+the creation of a Derivative Work. 
29
+— ‘The Licensee’ or ‘You’:any natural or legal person who makes any usage of the Work under the terms of the 
30
+Licence. 
31
+— ‘Distribution’ or ‘Communication’:any act of selling, giving, lending, renting, distributing, communicating, 
32
+transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential 
33
+functionalities at the disposal of any other natural or legal person. 
34
+
35
+2.Scope of the rights granted by the Licence 
36
+The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for 
37
+the duration of copyright vested in the Original Work: 
38
+— use the Work in any circumstance and for all usage, 
39
+— reproduce the Work, 
40
+— modify the Work, and make Derivative Works based upon the Work, 
41
+— communicate to the public, including the right to make available or display the Work or copies thereof to the public 
42
+and perform publicly, as the case may be, the Work, 
43
+— distribute the Work or copies thereof, 
44
+— lend and rent the Work or copies thereof, 
45
+— sublicense rights in the Work or copies thereof. 
46
+Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the 
47
+applicable law permits so. 
48
+In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed 
49
+by law in order to make effective the licence of the economic rights here above listed. 
50
+The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the 
51
+extent necessary to make use of the rights granted on the Work under this Licence. 
52
+
53
+3.Communication of the Source Code 
54
+The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as 
55
+Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with 
56
+each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to 
57
+the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to 
58
+distribute or communicate the Work. 
59
+
60
+4.Limitations on copyright 
61
+Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the 
62
+exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations 
63
+thereto. 
64
+
65
+5.Obligations of the Licensee 
66
+The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those 
67
+obligations are the following: 
68
+
69
+Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to 
70
+the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the 
71
+Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work 
72
+to carry prominent notices stating that the Work has been modified and the date of modification. 
73
+
74
+Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this 
75
+Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless 
76
+the Original Work is expressly distributed only under this version of the Licence — for example by communicating 
77
+‘EUPL v. 1.2 only’. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the 
78
+Work or Derivative Work that alter or restrict the terms of the Licence. 
79
+
80
+Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both 
81
+the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done 
82
+under the terms of this Compatible Licence. For the sake of this clause, ‘Compatible Licence’ refers to the licences listed 
83
+in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with 
84
+his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail. 
85
+
86
+Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide 
87
+a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available 
88
+for as long as the Licensee continues to distribute or communicate the Work. 
89
+Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names 
90
+of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and 
91
+reproducing the content of the copyright notice. 
92
+
93
+6.Chain of Authorship 
94
+The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or 
95
+licensed to him/her and that he/she has the power and authority to grant the Licence. 
96
+Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or 
97
+licensed to him/her and that he/she has the power and authority to grant the Licence. 
98
+Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions 
99
+to the Work, under the terms of this Licence. 
100
+
101
+7.Disclaimer of Warranty 
102
+The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work 
103
+and may therefore contain defects or ‘bugs’ inherent to this type of development. 
104
+For the above reason, the Work is provided under the Licence on an ‘as is’ basis and without warranties of any kind 
105
+concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or 
106
+errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this 
107
+Licence. 
108
+This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work. 
109
+
110
+8.Disclaimer of Liability 
111
+Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be 
112
+liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the 
113
+Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss 
114
+of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However, 
115
+the Licensor will be liable under statutory product liability laws as far such laws apply to the Work. 
116
+
117
+9.Additional agreements 
118
+While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services 
119
+consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole 
120
+responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify, 
121
+defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by 
122
+the fact You have accepted any warranty or additional liability. 
123
+
124
+10.Acceptance of the Licence 
125
+The provisions of this Licence can be accepted by clicking on an icon ‘I agree’ placed under the bottom of a window 
126
+displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of 
127
+applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms 
128
+and conditions. 
129
+Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You 
130
+by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution 
131
+or Communication by You of the Work or copies thereof. 
132
+
133
+11.Information to the public 
134
+In case of any Distribution or Communication of the Work by means of electronic communication by You (for example, 
135
+by offering to download the Work from a remote location) the distribution channel or media (for example, a website) 
136
+must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence 
137
+and the way it may be accessible, concluded, stored and reproduced by the Licensee. 
138
+
139
+12.Termination of the Licence 
140
+The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms 
141
+of the Licence. 
142
+Such a termination will not terminate the licences of any person who has received the Work from the Licensee under 
143
+the Licence, provided such persons remain in full compliance with the Licence. 
144
+
145
+13.Miscellaneous 
146
+Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the 
147
+Work. 
148
+If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or 
149
+enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid 
150
+and enforceable. 
151
+The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of 
152
+the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence. 
153
+New versions of the Licence will be published with a unique version number. 
154
+All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take 
155
+advantage of the linguistic version of their choice. 
156
+
157
+14.Jurisdiction 
158
+Without prejudice to specific agreement between parties, 
159
+— any litigation resulting from the interpretation of this License, arising between the European Union institutions, 
160
+bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice 
161
+of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union, 
162
+— any litigation arising between other parties and resulting from the interpretation of this License, will be subject to 
163
+the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business. 
164
+
165
+15.Applicable Law 
166
+Without prejudice to specific agreement between parties, 
167
+— this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat, 
168
+resides or has his registered office, 
169
+— this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside 
170
+a European Union Member State. 

+ 1
- 0
README.md View File

@@ -0,0 +1 @@
1
+# Python Core Template

+ 10
- 0
cookiecutter.json View File

@@ -0,0 +1,10 @@
1
+{
2
+    "name": "project",
3
+    "email": "anon@local",
4
+    "author": "anonymous",
5
+    "python": "3.7.0",
6
+    "license": "GPLv3",
7
+    "control": "github.com",
8
+    "username": "anonymous",
9
+    "homepage": "https://{{cookiecutter.control}}/{{cookiecutter.username}}/{{cookiecutter.name}}"
10
+}

+ 3
- 0
hooks/post_gen_project.sh View File

@@ -0,0 +1,3 @@
1
+#!/bin/sh
2
+
3
+git init

+ 14
- 0
{{cookiecutter.name}}/.gitignore View File

@@ -0,0 +1,14 @@
1
+.tox
2
+.env
3
+venv/
4
+build/
5
+.cache
6
+*.py[cod]
7
+.coverage
8
+.hypothesis
9
+*.egg-info/
10
+__pycache__/
11
+.mypy_cache/
12
+.pytest_cache/
13
+.ipynb_checkpoints/
14
+

+ 1
- 0
{{cookiecutter.name}}/.python-version View File

@@ -0,0 +1 @@
1
+{{cookiecutter.python}}

+ 1
- 0
{{cookiecutter.name}}/LICENSE.txt View File

@@ -0,0 +1 @@
1
+{{cookiecutter.license}}

+ 9
- 0
{{cookiecutter.name}}/Makefile View File

@@ -0,0 +1,9 @@
1
+all: ;
2
+
3
+include */Makefile
4
+
5
+venv:
6
+	python -m venv venv --clear
7
+
8
+init: venv
9
+	for mk in $(wildcard */Makefile); do make -f $$mk; done

+ 1
- 0
{{cookiecutter.name}}/README.md View File

@@ -0,0 +1 @@
1
+# {{cookiecutter.name}}

+ 3
- 0
{{cookiecutter.name}}/dev/Makefile View File

@@ -0,0 +1,3 @@
1
+init-dev:
2
+	venv/bin/pip install -e .
3
+	venv/bin/pip install '.[dev]'

+ 2
- 0
{{cookiecutter.name}}/dev/requirements.txt View File

@@ -0,0 +1,2 @@
1
+pip>=18.0
2
+setuptools

+ 0
- 0
{{cookiecutter.name}}/requirements.txt View File


+ 41
- 0
{{cookiecutter.name}}/setup.py View File

@@ -0,0 +1,41 @@
1
+#!/usr/bin/env python
2
+
3
+import os
4
+import glob
5
+import setuptools  # type: ignore
6
+
7
+root = os.path.abspath(os.path.dirname(__file__))
8
+
9
+
10
+def requires(requirements="requirements.txt"):
11
+    path = os.path.join(root, requirements)
12
+
13
+    with open(path, "r") as f:
14
+        return f.read().splitlines()
15
+
16
+
17
+info = dict(
18
+    name="{{cookiecutter.name}}",
19
+    version="0.0.0",
20
+    license="{{cookiecutter.license}}",
21
+    author="{{cookiecutter.author}}",
22
+    author_email="{{cookiecutter.email}}",
23
+    description="TODO: write a description",
24
+    long_description_content_type="text/markdown",
25
+    long_description=open("README.md", "r").read(),
26
+    url="{{cookiecutter.homepage}}",
27
+    packages=["{{cookiecutter.name}}"],
28
+    keywords="sample project template",
29
+    classifiers=[
30
+        "Development Status :: 3 - Alpha",
31
+        "Programming Language :: Python :: 3",
32
+    ],
33
+    extras_require={
34
+        os.path.dirname(f): requires(f) for f in glob.glob("*/requirements.txt")
35
+    },
36
+    python_requires=">={{cookiecutter.python}}",
37
+    install_requires=requires(),
38
+)
39
+
40
+if __name__ == "__main__":
41
+    setuptools.setup(**info)

+ 0
- 0
{{cookiecutter.name}}/{{cookiecutter.name}}/__init__.py View File