cachub 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ =======
2
+ Credits
3
+ =======
4
+
5
+ Development Lead
6
+ ----------------
7
+
8
+ .. {# pkglts, doc.authors
9
+
10
+ * revesansparole, <revesansparole@gmail.com>
11
+
12
+ .. #}
13
+
14
+ Contributors
15
+ ------------
16
+
17
+ .. {# pkglts, doc.contributors
18
+
19
+ * revesansparole <revesansparole@gmail.com>
20
+ * Jerome Chopard <revesansparole@gmail.com>
21
+
22
+ .. #}
cachub-0.1.1/LICENSE ADDED
@@ -0,0 +1,337 @@
1
+ {# pkglts, license
2
+ Creative Commons Legal Code
3
+
4
+ Attribution-NonCommercial 3.0 Unported
5
+
6
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
7
+ LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
8
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
9
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
10
+ REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
11
+ DAMAGES RESULTING FROM ITS USE.
12
+
13
+ License
14
+
15
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
16
+ COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
17
+ COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
18
+ AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
19
+
20
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
21
+ TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
22
+ BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
23
+ CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
24
+ CONDITIONS.
25
+
26
+ 1. Definitions
27
+
28
+ a. "Adaptation" means a work based upon the Work, or upon the Work and
29
+ other pre-existing works, such as a translation, adaptation,
30
+ derivative work, arrangement of music or other alterations of a
31
+ literary or artistic work, or phonogram or performance and includes
32
+ cinematographic adaptations or any other form in which the Work may be
33
+ recast, transformed, or adapted including in any form recognizably
34
+ derived from the original, except that a work that constitutes a
35
+ Collection will not be considered an Adaptation for the purpose of
36
+ this License. For the avoidance of doubt, where the Work is a musical
37
+ work, performance or phonogram, the synchronization of the Work in
38
+ timed-relation with a moving image ("synching") will be considered an
39
+ Adaptation for the purpose of this License.
40
+ b. "Collection" means a collection of literary or artistic works, such as
41
+ encyclopedias and anthologies, or performances, phonograms or
42
+ broadcasts, or other works or subject matter other than works listed
43
+ in Section 1(f) below, which, by reason of the selection and
44
+ arrangement of their contents, constitute intellectual creations, in
45
+ which the Work is included in its entirety in unmodified form along
46
+ with one or more other contributions, each constituting separate and
47
+ independent works in themselves, which together are assembled into a
48
+ collective whole. A work that constitutes a Collection will not be
49
+ considered an Adaptation (as defined above) for the purposes of this
50
+ License.
51
+ c. "Distribute" means to make available to the public the original and
52
+ copies of the Work or Adaptation, as appropriate, through sale or
53
+ other transfer of ownership.
54
+ d. "Licensor" means the individual, individuals, entity or entities that
55
+ offer(s) the Work under the terms of this License.
56
+ e. "Original Author" means, in the case of a literary or artistic work,
57
+ the individual, individuals, entity or entities who created the Work
58
+ or if no individual or entity can be identified, the publisher; and in
59
+ addition (i) in the case of a performance the actors, singers,
60
+ musicians, dancers, and other persons who act, sing, deliver, declaim,
61
+ play in, interpret or otherwise perform literary or artistic works or
62
+ expressions of folklore; (ii) in the case of a phonogram the producer
63
+ being the person or legal entity who first fixes the sounds of a
64
+ performance or other sounds; and, (iii) in the case of broadcasts, the
65
+ organization that transmits the broadcast.
66
+ f. "Work" means the literary and/or artistic work offered under the terms
67
+ of this License including without limitation any production in the
68
+ literary, scientific and artistic domain, whatever may be the mode or
69
+ form of its expression including digital form, such as a book,
70
+ pamphlet and other writing; a lecture, address, sermon or other work
71
+ of the same nature; a dramatic or dramatico-musical work; a
72
+ choreographic work or entertainment in dumb show; a musical
73
+ composition with or without words; a cinematographic work to which are
74
+ assimilated works expressed by a process analogous to cinematography;
75
+ a work of drawing, painting, architecture, sculpture, engraving or
76
+ lithography; a photographic work to which are assimilated works
77
+ expressed by a process analogous to photography; a work of applied
78
+ art; an illustration, map, plan, sketch or three-dimensional work
79
+ relative to geography, topography, architecture or science; a
80
+ performance; a broadcast; a phonogram; a compilation of data to the
81
+ extent it is protected as a copyrightable work; or a work performed by
82
+ a variety or circus performer to the extent it is not otherwise
83
+ considered a literary or artistic work.
84
+ g. "You" means an individual or entity exercising rights under this
85
+ License who has not previously violated the terms of this License with
86
+ respect to the Work, or who has received express permission from the
87
+ Licensor to exercise rights under this License despite a previous
88
+ violation.
89
+ h. "Publicly Perform" means to perform public recitations of the Work and
90
+ to communicate to the public those public recitations, by any means or
91
+ process, including by wire or wireless means or public digital
92
+ performances; to make available to the public Works in such a way that
93
+ members of the public may access these Works from a place and at a
94
+ place individually chosen by them; to perform the Work to the public
95
+ by any means or process and the communication to the public of the
96
+ performances of the Work, including by public digital performance; to
97
+ broadcast and rebroadcast the Work by any means including signs,
98
+ sounds or images.
99
+ i. "Reproduce" means to make copies of the Work by any means including
100
+ without limitation by sound or visual recordings and the right of
101
+ fixation and reproducing fixations of the Work, including storage of a
102
+ protected performance or phonogram in digital form or other electronic
103
+ medium.
104
+
105
+ 2. Fair Dealing Rights. Nothing in this License is intended to reduce,
106
+ limit, or restrict any uses free from copyright or rights arising from
107
+ limitations or exceptions that are provided for in connection with the
108
+ copyright protection under copyright law or other applicable laws.
109
+
110
+ 3. License Grant. Subject to the terms and conditions of this License,
111
+ Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
112
+ perpetual (for the duration of the applicable copyright) license to
113
+ exercise the rights in the Work as stated below:
114
+
115
+ a. to Reproduce the Work, to incorporate the Work into one or more
116
+ Collections, and to Reproduce the Work as incorporated in the
117
+ Collections;
118
+ b. to create and Reproduce Adaptations provided that any such Adaptation,
119
+ including any translation in any medium, takes reasonable steps to
120
+ clearly label, demarcate or otherwise identify that changes were made
121
+ to the original Work. For example, a translation could be marked "The
122
+ original work was translated from English to Spanish," or a
123
+ modification could indicate "The original work has been modified.";
124
+ c. to Distribute and Publicly Perform the Work including as incorporated
125
+ in Collections; and,
126
+ d. to Distribute and Publicly Perform Adaptations.
127
+
128
+ The above rights may be exercised in all media and formats whether now
129
+ known or hereafter devised. The above rights include the right to make
130
+ such modifications as are technically necessary to exercise the rights in
131
+ other media and formats. Subject to Section 8(f), all rights not expressly
132
+ granted by Licensor are hereby reserved, including but not limited to the
133
+ rights set forth in Section 4(d).
134
+
135
+ 4. Restrictions. The license granted in Section 3 above is expressly made
136
+ subject to and limited by the following restrictions:
137
+
138
+ a. You may Distribute or Publicly Perform the Work only under the terms
139
+ of this License. You must include a copy of, or the Uniform Resource
140
+ Identifier (URI) for, this License with every copy of the Work You
141
+ Distribute or Publicly Perform. You may not offer or impose any terms
142
+ on the Work that restrict the terms of this License or the ability of
143
+ the recipient of the Work to exercise the rights granted to that
144
+ recipient under the terms of the License. You may not sublicense the
145
+ Work. You must keep intact all notices that refer to this License and
146
+ to the disclaimer of warranties with every copy of the Work You
147
+ Distribute or Publicly Perform. When You Distribute or Publicly
148
+ Perform the Work, You may not impose any effective technological
149
+ measures on the Work that restrict the ability of a recipient of the
150
+ Work from You to exercise the rights granted to that recipient under
151
+ the terms of the License. This Section 4(a) applies to the Work as
152
+ incorporated in a Collection, but this does not require the Collection
153
+ apart from the Work itself to be made subject to the terms of this
154
+ License. If You create a Collection, upon notice from any Licensor You
155
+ must, to the extent practicable, remove from the Collection any credit
156
+ as required by Section 4(c), as requested. If You create an
157
+ Adaptation, upon notice from any Licensor You must, to the extent
158
+ practicable, remove from the Adaptation any credit as required by
159
+ Section 4(c), as requested.
160
+ b. You may not exercise any of the rights granted to You in Section 3
161
+ above in any manner that is primarily intended for or directed toward
162
+ commercial advantage or private monetary compensation. The exchange of
163
+ the Work for other copyrighted works by means of digital file-sharing
164
+ or otherwise shall not be considered to be intended for or directed
165
+ toward commercial advantage or private monetary compensation, provided
166
+ there is no payment of any monetary compensation in connection with
167
+ the exchange of copyrighted works.
168
+ c. If You Distribute, or Publicly Perform the Work or any Adaptations or
169
+ Collections, You must, unless a request has been made pursuant to
170
+ Section 4(a), keep intact all copyright notices for the Work and
171
+ provide, reasonable to the medium or means You are utilizing: (i) the
172
+ name of the Original Author (or pseudonym, if applicable) if supplied,
173
+ and/or if the Original Author and/or Licensor designate another party
174
+ or parties (e.g., a sponsor institute, publishing entity, journal) for
175
+ attribution ("Attribution Parties") in Licensor's copyright notice,
176
+ terms of service or by other reasonable means, the name of such party
177
+ or parties; (ii) the title of the Work if supplied; (iii) to the
178
+ extent reasonably practicable, the URI, if any, that Licensor
179
+ specifies to be associated with the Work, unless such URI does not
180
+ refer to the copyright notice or licensing information for the Work;
181
+ and, (iv) consistent with Section 3(b), in the case of an Adaptation,
182
+ a credit identifying the use of the Work in the Adaptation (e.g.,
183
+ "French translation of the Work by Original Author," or "Screenplay
184
+ based on original Work by Original Author"). The credit required by
185
+ this Section 4(c) may be implemented in any reasonable manner;
186
+ provided, however, that in the case of a Adaptation or Collection, at
187
+ a minimum such credit will appear, if a credit for all contributing
188
+ authors of the Adaptation or Collection appears, then as part of these
189
+ credits and in a manner at least as prominent as the credits for the
190
+ other contributing authors. For the avoidance of doubt, You may only
191
+ use the credit required by this Section for the purpose of attribution
192
+ in the manner set out above and, by exercising Your rights under this
193
+ License, You may not implicitly or explicitly assert or imply any
194
+ connection with, sponsorship or endorsement by the Original Author,
195
+ Licensor and/or Attribution Parties, as appropriate, of You or Your
196
+ use of the Work, without the separate, express prior written
197
+ permission of the Original Author, Licensor and/or Attribution
198
+ Parties.
199
+ d. For the avoidance of doubt:
200
+
201
+ i. Non-waivable Compulsory License Schemes. In those jurisdictions in
202
+ which the right to collect royalties through any statutory or
203
+ compulsory licensing scheme cannot be waived, the Licensor
204
+ reserves the exclusive right to collect such royalties for any
205
+ exercise by You of the rights granted under this License;
206
+ ii. Waivable Compulsory License Schemes. In those jurisdictions in
207
+ which the right to collect royalties through any statutory or
208
+ compulsory licensing scheme can be waived, the Licensor reserves
209
+ the exclusive right to collect such royalties for any exercise by
210
+ You of the rights granted under this License if Your exercise of
211
+ such rights is for a purpose or use which is otherwise than
212
+ noncommercial as permitted under Section 4(b) and otherwise waives
213
+ the right to collect royalties through any statutory or compulsory
214
+ licensing scheme; and,
215
+ iii. Voluntary License Schemes. The Licensor reserves the right to
216
+ collect royalties, whether individually or, in the event that the
217
+ Licensor is a member of a collecting society that administers
218
+ voluntary licensing schemes, via that society, from any exercise
219
+ by You of the rights granted under this License that is for a
220
+ purpose or use which is otherwise than noncommercial as permitted
221
+ under Section 4(c).
222
+ e. Except as otherwise agreed in writing by the Licensor or as may be
223
+ otherwise permitted by applicable law, if You Reproduce, Distribute or
224
+ Publicly Perform the Work either by itself or as part of any
225
+ Adaptations or Collections, You must not distort, mutilate, modify or
226
+ take other derogatory action in relation to the Work which would be
227
+ prejudicial to the Original Author's honor or reputation. Licensor
228
+ agrees that in those jurisdictions (e.g. Japan), in which any exercise
229
+ of the right granted in Section 3(b) of this License (the right to
230
+ make Adaptations) would be deemed to be a distortion, mutilation,
231
+ modification or other derogatory action prejudicial to the Original
232
+ Author's honor and reputation, the Licensor will waive or not assert,
233
+ as appropriate, this Section, to the fullest extent permitted by the
234
+ applicable national law, to enable You to reasonably exercise Your
235
+ right under Section 3(b) of this License (right to make Adaptations)
236
+ but not otherwise.
237
+
238
+ 5. Representations, Warranties and Disclaimer
239
+
240
+ UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
241
+ OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
242
+ KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
243
+ INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
244
+ FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
245
+ LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
246
+ WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
247
+ OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
248
+
249
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
250
+ LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
251
+ ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
252
+ ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
253
+ BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
254
+
255
+ 7. Termination
256
+
257
+ a. This License and the rights granted hereunder will terminate
258
+ automatically upon any breach by You of the terms of this License.
259
+ Individuals or entities who have received Adaptations or Collections
260
+ from You under this License, however, will not have their licenses
261
+ terminated provided such individuals or entities remain in full
262
+ compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
263
+ survive any termination of this License.
264
+ b. Subject to the above terms and conditions, the license granted here is
265
+ perpetual (for the duration of the applicable copyright in the Work).
266
+ Notwithstanding the above, Licensor reserves the right to release the
267
+ Work under different license terms or to stop distributing the Work at
268
+ any time; provided, however that any such election will not serve to
269
+ withdraw this License (or any other license that has been, or is
270
+ required to be, granted under the terms of this License), and this
271
+ License will continue in full force and effect unless terminated as
272
+ stated above.
273
+
274
+ 8. Miscellaneous
275
+
276
+ a. Each time You Distribute or Publicly Perform the Work or a Collection,
277
+ the Licensor offers to the recipient a license to the Work on the same
278
+ terms and conditions as the license granted to You under this License.
279
+ b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
280
+ offers to the recipient a license to the original Work on the same
281
+ terms and conditions as the license granted to You under this License.
282
+ c. If any provision of this License is invalid or unenforceable under
283
+ applicable law, it shall not affect the validity or enforceability of
284
+ the remainder of the terms of this License, and without further action
285
+ by the parties to this agreement, such provision shall be reformed to
286
+ the minimum extent necessary to make such provision valid and
287
+ enforceable.
288
+ d. No term or provision of this License shall be deemed waived and no
289
+ breach consented to unless such waiver or consent shall be in writing
290
+ and signed by the party to be charged with such waiver or consent.
291
+ e. This License constitutes the entire agreement between the parties with
292
+ respect to the Work licensed here. There are no understandings,
293
+ agreements or representations with respect to the Work not specified
294
+ here. Licensor shall not be bound by any additional provisions that
295
+ may appear in any communication from You. This License may not be
296
+ modified without the mutual written agreement of the Licensor and You.
297
+ f. The rights granted under, and the subject matter referenced, in this
298
+ License were drafted utilizing the terminology of the Berne Convention
299
+ for the Protection of Literary and Artistic Works (as amended on
300
+ September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
301
+ Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
302
+ and the Universal Copyright Convention (as revised on July 24, 1971).
303
+ These rights and subject matter take effect in the relevant
304
+ jurisdiction in which the License terms are sought to be enforced
305
+ according to the corresponding provisions of the implementation of
306
+ those treaty provisions in the applicable national law. If the
307
+ standard suite of rights granted under applicable copyright law
308
+ includes additional rights not granted under this License, such
309
+ additional rights are deemed to be included in the License; this
310
+ License is not intended to restrict the license of any rights under
311
+ applicable law.
312
+
313
+
314
+ Creative Commons Notice
315
+
316
+ Creative Commons is not a party to this License, and makes no warranty
317
+ whatsoever in connection with the Work. Creative Commons will not be
318
+ liable to You or any party on any legal theory for any damages
319
+ whatsoever, including without limitation any general, special,
320
+ incidental or consequential damages arising in connection to this
321
+ license. Notwithstanding the foregoing two (2) sentences, if Creative
322
+ Commons has expressly identified itself as the Licensor hereunder, it
323
+ shall have all rights and obligations of Licensor.
324
+
325
+ Except for the limited purpose of indicating to the public that the
326
+ Work is licensed under the CCPL, Creative Commons does not authorize
327
+ the use by either party of the trademark "Creative Commons" or any
328
+ related trademark or logo of Creative Commons without the prior
329
+ written consent of Creative Commons. Any permitted use will be in
330
+ compliance with Creative Commons' then-current trademark usage
331
+ guidelines, as may be published on its website or otherwise made
332
+ available upon request from time to time. For the avoidance of doubt,
333
+ this trademark restriction does not form part of the License.
334
+
335
+ Creative Commons may be contacted at http://creativecommons.org/.
336
+
337
+ #}
cachub-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: cachub
3
+ Version: 0.1.1
4
+ Summary: Cache data from varied providers
5
+ Author-email: revesansparole <revesansparole@gmail.com>
6
+ Maintainer-email: revesansparole <revesansparole@gmail.com>, Jerome Chopard <revesansparole@gmail.com>
7
+ License: cc_by_nc
8
+ Project-URL: repository, https://gitlab.com/revesansparole/cachub
9
+ Project-URL: pip, https://pypi.org/project/cachub/0.1.1/
10
+ Project-URL: conda, https://anaconda.org/revesansparole/cachub
11
+ Project-URL: doc, https://revesansparole.gitlab.io/cachub/
12
+ Project-URL: pypi, https://badge.fury.io/py/cachub
13
+ Classifier: Development Status :: 2 - Pre-Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: BSD License
16
+ Classifier: Natural Language :: English
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/x-rst
24
+ License-File: LICENSE
25
+ License-File: AUTHORS.rst
26
+ Requires-Dist: bcrypt
27
+ Requires-Dist: easyprov
28
+ Requires-Dist: flask
29
+ Requires-Dist: pandas
30
+ Requires-Dist: pyjwt
31
+ Requires-Dist: requests
32
+ Provides-Extra: doc
33
+ Requires-Dist: sphinx; extra == "doc"
34
+ Requires-Dist: sphinx-gallery; extra == "doc"
35
+ Requires-Dist: sphinx-rtd-theme; extra == "doc"
36
+ Provides-Extra: dvlpt
37
+ Requires-Dist: black; extra == "dvlpt"
38
+ Requires-Dist: twine; extra == "dvlpt"
39
+ Provides-Extra: test
40
+ Requires-Dist: coverage; extra == "test"
41
+ Requires-Dist: pytest; extra == "test"
42
+ Requires-Dist: pytest-cov; extra == "test"
43
+ Requires-Dist: pytest-mock; extra == "test"
44
+ Dynamic: license-file
45
+
46
+ ========================
47
+ cachub
48
+ ========================
49
+
50
+ .. {# pkglts, doc
51
+
52
+ .. image:: https://revesansparole.gitlab.io/cachub/_images/badge_pkging_pip.svg
53
+ :alt: PyPI version
54
+ :target: https://pypi.org/project/cachub/0.1.1/
55
+
56
+ .. image:: https://revesansparole.gitlab.io/cachub/_images/badge_pkging_conda.svg
57
+ :alt: Conda version
58
+ :target: https://anaconda.org/revesansparole/cachub
59
+
60
+ .. image:: https://revesansparole.gitlab.io/cachub/_images/badge_doc.svg
61
+ :alt: Documentation status
62
+ :target: https://revesansparole.gitlab.io/cachub/
63
+
64
+ .. image:: https://badge.fury.io/py/cachub.svg
65
+ :alt: PyPI version
66
+ :target: https://badge.fury.io/py/cachub
67
+
68
+ .. #}
69
+ .. {# pkglts, glabpkg_dev, after doc
70
+
71
+ main: |main_build|_ |main_coverage|_
72
+
73
+ .. |main_build| image:: https://gitlab.com/revesansparole/cachub/badges/main/pipeline.svg
74
+ .. _main_build: https://gitlab.com/revesansparole/cachub/commits/main
75
+
76
+ .. |main_coverage| image:: https://gitlab.com/revesansparole/cachub/badges/main/coverage.svg
77
+ .. _main_coverage: https://gitlab.com/revesansparole/cachub/commits/main
78
+ .. #}
79
+
80
+ Cache data from varied providers
81
+
@@ -0,0 +1,36 @@
1
+ ========================
2
+ cachub
3
+ ========================
4
+
5
+ .. {# pkglts, doc
6
+
7
+ .. image:: https://revesansparole.gitlab.io/cachub/_images/badge_pkging_pip.svg
8
+ :alt: PyPI version
9
+ :target: https://pypi.org/project/cachub/0.1.1/
10
+
11
+ .. image:: https://revesansparole.gitlab.io/cachub/_images/badge_pkging_conda.svg
12
+ :alt: Conda version
13
+ :target: https://anaconda.org/revesansparole/cachub
14
+
15
+ .. image:: https://revesansparole.gitlab.io/cachub/_images/badge_doc.svg
16
+ :alt: Documentation status
17
+ :target: https://revesansparole.gitlab.io/cachub/
18
+
19
+ .. image:: https://badge.fury.io/py/cachub.svg
20
+ :alt: PyPI version
21
+ :target: https://badge.fury.io/py/cachub
22
+
23
+ .. #}
24
+ .. {# pkglts, glabpkg_dev, after doc
25
+
26
+ main: |main_build|_ |main_coverage|_
27
+
28
+ .. |main_build| image:: https://gitlab.com/revesansparole/cachub/badges/main/pipeline.svg
29
+ .. _main_build: https://gitlab.com/revesansparole/cachub/commits/main
30
+
31
+ .. |main_coverage| image:: https://gitlab.com/revesansparole/cachub/badges/main/coverage.svg
32
+ .. _main_coverage: https://gitlab.com/revesansparole/cachub/commits/main
33
+ .. #}
34
+
35
+ Cache data from varied providers
36
+
@@ -0,0 +1,96 @@
1
+ # {# pkglts, pyproject.build
2
+ [build-system]
3
+ # Minimum requirements for the build system to execute.
4
+ requires = ["setuptools", "wheel"] # , "setuptools-scm"] # PEP 508 specifications.
5
+ build-backend = "setuptools.build_meta" # we don't know if we need it
6
+ # #}
7
+
8
+ # {# pkglts, pyproject.project
9
+ [project] # https://packaging.python.org/en/latest/specifications/pyproject-toml/
10
+ name = "cachub"
11
+ version = "0.1.1"
12
+ description = "Cache data from varied providers"
13
+ readme = "README.rst"
14
+ requires-python = ">= 3.10"
15
+ license = {text = "cc_by_nc"}
16
+ authors = [
17
+ {name = "revesansparole", email = "revesansparole@gmail.com"},
18
+ ]
19
+ maintainers = [
20
+ {name = "revesansparole", email = "revesansparole@gmail.com"},
21
+ {name = "Jerome Chopard", email = "revesansparole@gmail.com"},
22
+ ]
23
+ keywords = [
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 2 - Pre-Alpha",
27
+ "Intended Audience :: Developers",
28
+ "License :: OSI Approved :: BSD License",
29
+ "Natural Language :: English",
30
+ "Programming Language :: Python",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3 :: Only",
33
+ "Programming Language :: Python :: 3.10",
34
+ "Programming Language :: Python :: 3.11",
35
+ ]
36
+ dependencies = [
37
+ "bcrypt",
38
+ "easyprov",
39
+ "flask",
40
+ "pandas",
41
+ "pyjwt",
42
+ "requests",
43
+ ]
44
+
45
+ [project.optional-dependencies]
46
+ doc = [
47
+ "sphinx",
48
+ "sphinx-gallery",
49
+ "sphinx-rtd-theme",
50
+ ]
51
+ dvlpt = [
52
+ "black",
53
+ "twine",
54
+ ]
55
+ test = [
56
+ "coverage",
57
+ "pytest",
58
+ "pytest-cov",
59
+ "pytest-mock",
60
+ ]
61
+
62
+
63
+ [project.urls]
64
+ repository = "https://gitlab.com/revesansparole/cachub"
65
+ pip = "https://pypi.org/project/cachub/0.1.1/"
66
+ conda = "https://anaconda.org/revesansparole/cachub"
67
+ doc = "https://revesansparole.gitlab.io/cachub/"
68
+ pypi = "https://badge.fury.io/py/cachub"
69
+
70
+
71
+ [tool.setuptools]
72
+ include-package-data = true
73
+
74
+ [tool.setuptools.packages.find]
75
+ where = ["src"]
76
+
77
+ [tool.setuptools.package-data]
78
+ "*" = ['*.json', '*.ini', '*.csv', '*.rst', '*.svg', ]
79
+
80
+ # #}
81
+ # {# pkglts, glabpkg_dev, after pyproject.project
82
+ [tool.black]
83
+ line-length = 120
84
+ # #}
85
+ # {# pkglts, test, after pyproject.project
86
+ [tool.pytest.ini_options]
87
+ addopts = "--maxfail=2 -rf --cov=cachub"
88
+ # #}
89
+
90
+ # {# pkglts, pyproject.scripts
91
+ [project.scripts]
92
+ # #}
93
+
94
+ # {# pkglts, pyproject.gui_scripts
95
+ [project.gui-scripts]
96
+ # #}
cachub-0.1.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,11 @@
1
+ """
2
+ Cache data from varied providers
3
+ """
4
+ # {# pkglts, src
5
+ # FYEO
6
+ # #}
7
+ # {# pkglts, version, after src
8
+ from . import version
9
+
10
+ __version__ = version.__version__
11
+ # #}
@@ -0,0 +1,36 @@
1
+ import os
2
+ from io import StringIO
3
+
4
+ import pandas as pd
5
+ import requests
6
+
7
+
8
+ class CachubClient:
9
+ def __init__(self, base_url=None, token=None):
10
+ self.base_url = base_url
11
+ self.token = token
12
+
13
+ @staticmethod
14
+ def from_env_properties():
15
+ return CachubClient(os.environ["CACHUB_URL"], os.environ["CACHUB_TOKEN"])
16
+
17
+ def fetch(self, provider, **kwds):
18
+ """Fetch data from given provider
19
+
20
+ Args:
21
+ provider (str): name of provider to use
22
+ **kwds: arguments for provider
23
+
24
+ Returns:
25
+ (dict, pd.DataFrame): header, data
26
+ """
27
+ response = requests.post(f"{self.base_url}/api/{provider}", json=kwds,
28
+ headers={'Authorization': f"Bearer {self.token}"})
29
+
30
+ if response.status_code != 200:
31
+ raise UserWarning(f"Invalid request code '{response.status_code}'")
32
+
33
+ resp = response.json()
34
+ df = pd.read_csv(StringIO(resp["data"]), sep=";")
35
+
36
+ return resp["header"], df
@@ -0,0 +1,20 @@
1
+ """
2
+ Handle configuration for this package install
3
+ """
4
+ import configparser
5
+ from pathlib import Path
6
+
7
+ pth_cfg = Path.home() / ".cachub"
8
+
9
+
10
+ def get_config():
11
+ if not pth_cfg.exists():
12
+ config = configparser.ConfigParser()
13
+ config['storage'] = {'pth': 'cachub/storage/'}
14
+ with open(pth_cfg, 'w') as fhw:
15
+ config.write(fhw)
16
+
17
+ config = configparser.ConfigParser()
18
+ config.read(pth_cfg)
19
+
20
+ return config