First release
continuous-integration/drone Build is passing Details

This commit is contained in:
Anna “CyberTailor” 2024-01-07 02:15:52 +05:00
parent 199c3c8f83
commit c9e8bd2adc
Signed by: CyberTaIlor
GPG Key ID: E7B76EDC50864BB1
37 changed files with 14812 additions and 0 deletions

10
.bumpversion.cfg Normal file
View File

@ -0,0 +1,10 @@
[bumpversion]
current_version = 0.0.1
commit = True
tag = True
tag_name = {new_version}
sign_tags = True
[bumpversion:file:docs/conf.py]
[bumpversion:file:repology_client/constants.py]

3
.bumpversion.cfg.license Normal file
View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Anna <cyber@sysrq.in>
SPDX-License-Identifier: CC0-1.0

16
.drone.yml Normal file
View File

@ -0,0 +1,16 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2023 Anna <cyber@sysrq.in>
kind: pipeline
type: docker
name: default
workspace:
path: /tests
steps:
- name: test
image: 31z4/tox:4
user: root
commands:
- tox run

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2022-2024 Anna <cyber@sysrq.in>
.tox
__pycache__
*.pyo
docs/_build
docs/api
dist
venv
*.sw[op]
*~

8
.reuse/dep5 Normal file
View File

@ -0,0 +1,8 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: repology-client
Upstream-Contact: Anna <cyber@sysrq.in>
Source: https://repology-client.sysrq.in/
Files: tests/cassettes/*
Copyright: Repology
License: CC0-1.0

190
LICENSE Normal file
View File

@ -0,0 +1,190 @@
EUROPEAN UNION PUBLIC LICENCE v. 1.2
EUPL © the European Union 2007, 2016
This European Union Public Licence (the EUPL) applies to the Work (as defined below) which is provided under the
terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such
use is covered by a right of the copyright holder of the Work).
The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following
notice immediately following the copyright notice for the Work:
Licensed under the EUPL
or has expressed by any other means his willingness to license under the EUPL.
1.Definitions
In this Licence, the following terms have the following meaning:
The Licence:this Licence.
The Original Work:the work or software distributed or communicated by the Licensor under this Licence, available
as Source Code and also as Executable Code as the case may be.
Derivative Works:the works or software that could be created by the Licensee, based upon the Original Work or
modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work
required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in
the country mentioned in Article 15.
The Work:the Original Work or its Derivative Works.
The Source Code:the human-readable form of the Work which is the most convenient for people to study and
modify.
The Executable Code:any code which has generally been compiled and which is meant to be interpreted by
a computer as a program.
The Licensor:the natural or legal person that distributes or communicates the Work under the Licence.
Contributor(s):any natural or legal person who modifies the Work under the Licence, or otherwise contributes to
the creation of a Derivative Work.
The Licensee or You:any natural or legal person who makes any usage of the Work under the terms of the
Licence.
Distribution or Communication:any act of selling, giving, lending, renting, distributing, communicating,
transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential
functionalities at the disposal of any other natural or legal person.
2.Scope of the rights granted by the Licence
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for
the duration of copyright vested in the Original Work:
— use the Work in any circumstance and for all usage,
— reproduce the Work,
— modify the Work, and make Derivative Works based upon the Work,
— communicate to the public, including the right to make available or display the Work or copies thereof to the public
and perform publicly, as the case may be, the Work,
— distribute the Work or copies thereof,
— lend and rent the Work or copies thereof,
— sublicense rights in the Work or copies thereof.
Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the
applicable law permits so.
In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed
by law in order to make effective the licence of the economic rights here above listed.
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the
extent necessary to make use of the rights granted on the Work under this Licence.
3.Communication of the Source Code
The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as
Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with
each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to
the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to
distribute or communicate the Work.
4.Limitations on copyright
Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the
exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations
thereto.
5.Obligations of the Licensee
The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those
obligations are the following:
Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to
the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the
Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work
to carry prominent notices stating that the Work has been modified and the date of modification.
Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this
Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless
the Original Work is expressly distributed only under this version of the Licence — for example by communicating
EUPL v. 1.2 only. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the
Work or Derivative Work that alter or restrict the terms of the Licence.
Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both
the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done
under the terms of this Compatible Licence. For the sake of this clause, Compatible Licence refers to the licences listed
in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with
his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail.
Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide
a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available
for as long as the Licensee continues to distribute or communicate the Work.
Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names
of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
reproducing the content of the copyright notice.
6.Chain of Authorship
The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or
licensed to him/her and that he/she has the power and authority to grant the Licence.
Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or
licensed to him/her and that he/she has the power and authority to grant the Licence.
Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions
to the Work, under the terms of this Licence.
7.Disclaimer of Warranty
The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work
and may therefore contain defects or bugs inherent to this type of development.
For the above reason, the Work is provided under the Licence on an as is basis and without warranties of any kind
concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or
errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this
Licence.
This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work.
8.Disclaimer of Liability
Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be
liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the
Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss
of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However,
the Licensor will be liable under statutory product liability laws as far such laws apply to the Work.
9.Additional agreements
While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services
consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole
responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by
the fact You have accepted any warranty or additional liability.
10.Acceptance of the Licence
The provisions of this Licence can be accepted by clicking on an icon I agree placed under the bottom of a window
displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of
applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms
and conditions.
Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You
by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution
or Communication by You of the Work or copies thereof.
11.Information to the public
In case of any Distribution or Communication of the Work by means of electronic communication by You (for example,
by offering to download the Work from a remote location) the distribution channel or media (for example, a website)
must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence
and the way it may be accessible, concluded, stored and reproduced by the Licensee.
12.Termination of the Licence
The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms
of the Licence.
Such a termination will not terminate the licences of any person who has received the Work from the Licensee under
the Licence, provided such persons remain in full compliance with the Licence.
13.Miscellaneous
Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the
Work.
If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or
enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid
and enforceable.
The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of
the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence.
New versions of the Licence will be published with a unique version number.
All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take
advantage of the linguistic version of their choice.
14.Jurisdiction
Without prejudice to specific agreement between parties,
— any litigation resulting from the interpretation of this License, arising between the European Union institutions,
bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice
of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union,
— any litigation arising between other parties and resulting from the interpretation of this License, will be subject to
the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
15.Applicable Law
Without prejudice to specific agreement between parties,
— this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat,
resides or has his registered office,
— this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside
a European Union Member State.
Appendix
Compatible Licences according to Article 5 EUPL are:
— GNU General Public License (GPL) v. 2, v. 3
— GNU Affero General Public License (AGPL) v. 3
— Open Software License (OSL) v. 2.1, v. 3.0
— Eclipse Public License (EPL) v. 1.0
— CeCILL v. 2.0, v. 2.1
— Mozilla Public Licence (MPL) v. 2
— GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software
— European Union Public Licence (EUPL) v. 1.1, v. 1.2
— Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+).
The European Commission may update this Appendix to later versions of the above licences without producing
a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the
covered Source Code from exclusive appropriation.
All other changes or additions to this Appendix require the production of a new EUPL version.

99
LICENSES/CC-BY-SA-3.0.txt Normal file
View File

@ -0,0 +1,99 @@
Creative Commons Attribution-ShareAlike 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
a. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
b. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License.
c. "Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License.
d. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
e. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
f. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
g. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
h. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
i. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
j. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
k. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
a. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
b. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
c. to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
d. to Distribute and Publicly Perform Adaptations.
e. For the avoidance of doubt:
i. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
ii. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
iii. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
a. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
b. You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
c. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
d. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
a. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
c. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
d. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
e. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
f. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
Creative Commons Notice
Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License.
Creative Commons may be contacted at http://creativecommons.org/.

121
LICENSES/CC0-1.0.txt Normal file
View File

@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.

190
LICENSES/EUPL-1.2.txt Normal file
View File

@ -0,0 +1,190 @@
EUROPEAN UNION PUBLIC LICENCE v. 1.2
EUPL © the European Union 2007, 2016
This European Union Public Licence (the EUPL) applies to the Work (as defined below) which is provided under the
terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such
use is covered by a right of the copyright holder of the Work).
The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following
notice immediately following the copyright notice for the Work:
Licensed under the EUPL
or has expressed by any other means his willingness to license under the EUPL.
1.Definitions
In this Licence, the following terms have the following meaning:
The Licence:this Licence.
The Original Work:the work or software distributed or communicated by the Licensor under this Licence, available
as Source Code and also as Executable Code as the case may be.
Derivative Works:the works or software that could be created by the Licensee, based upon the Original Work or
modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work
required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in
the country mentioned in Article 15.
The Work:the Original Work or its Derivative Works.
The Source Code:the human-readable form of the Work which is the most convenient for people to study and
modify.
The Executable Code:any code which has generally been compiled and which is meant to be interpreted by
a computer as a program.
The Licensor:the natural or legal person that distributes or communicates the Work under the Licence.
Contributor(s):any natural or legal person who modifies the Work under the Licence, or otherwise contributes to
the creation of a Derivative Work.
The Licensee or You:any natural or legal person who makes any usage of the Work under the terms of the
Licence.
Distribution or Communication:any act of selling, giving, lending, renting, distributing, communicating,
transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential
functionalities at the disposal of any other natural or legal person.
2.Scope of the rights granted by the Licence
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for
the duration of copyright vested in the Original Work:
— use the Work in any circumstance and for all usage,
— reproduce the Work,
— modify the Work, and make Derivative Works based upon the Work,
— communicate to the public, including the right to make available or display the Work or copies thereof to the public
and perform publicly, as the case may be, the Work,
— distribute the Work or copies thereof,
— lend and rent the Work or copies thereof,
— sublicense rights in the Work or copies thereof.
Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the
applicable law permits so.
In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed
by law in order to make effective the licence of the economic rights here above listed.
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the
extent necessary to make use of the rights granted on the Work under this Licence.
3.Communication of the Source Code
The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as
Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with
each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to
the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to
distribute or communicate the Work.
4.Limitations on copyright
Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the
exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations
thereto.
5.Obligations of the Licensee
The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those
obligations are the following:
Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to
the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the
Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work
to carry prominent notices stating that the Work has been modified and the date of modification.
Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this
Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless
the Original Work is expressly distributed only under this version of the Licence — for example by communicating
EUPL v. 1.2 only. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the
Work or Derivative Work that alter or restrict the terms of the Licence.
Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both
the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done
under the terms of this Compatible Licence. For the sake of this clause, Compatible Licence refers to the licences listed
in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with
his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail.
Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide
a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available
for as long as the Licensee continues to distribute or communicate the Work.
Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names
of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
reproducing the content of the copyright notice.
6.Chain of Authorship
The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or
licensed to him/her and that he/she has the power and authority to grant the Licence.
Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or
licensed to him/her and that he/she has the power and authority to grant the Licence.
Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions
to the Work, under the terms of this Licence.
7.Disclaimer of Warranty
The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work
and may therefore contain defects or bugs inherent to this type of development.
For the above reason, the Work is provided under the Licence on an as is basis and without warranties of any kind
concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or
errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this
Licence.
This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work.
8.Disclaimer of Liability
Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be
liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the
Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss
of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However,
the Licensor will be liable under statutory product liability laws as far such laws apply to the Work.
9.Additional agreements
While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services
consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole
responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by
the fact You have accepted any warranty or additional liability.
10.Acceptance of the Licence
The provisions of this Licence can be accepted by clicking on an icon I agree placed under the bottom of a window
displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of
applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms
and conditions.
Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You
by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution
or Communication by You of the Work or copies thereof.
11.Information to the public
In case of any Distribution or Communication of the Work by means of electronic communication by You (for example,
by offering to download the Work from a remote location) the distribution channel or media (for example, a website)
must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence
and the way it may be accessible, concluded, stored and reproduced by the Licensee.
12.Termination of the Licence
The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms
of the Licence.
Such a termination will not terminate the licences of any person who has received the Work from the Licensee under
the Licence, provided such persons remain in full compliance with the Licence.
13.Miscellaneous
Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the
Work.
If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or
enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid
and enforceable.
The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of
the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence.
New versions of the Licence will be published with a unique version number.
All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take
advantage of the linguistic version of their choice.
14.Jurisdiction
Without prejudice to specific agreement between parties,
— any litigation resulting from the interpretation of this License, arising between the European Union institutions,
bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice
of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union,
— any litigation arising between other parties and resulting from the interpretation of this License, will be subject to
the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business.
15.Applicable Law
Without prejudice to specific agreement between parties,
— this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat,
resides or has his registered office,
— this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside
a European Union Member State.
Appendix
Compatible Licences according to Article 5 EUPL are:
— GNU General Public License (GPL) v. 2, v. 3
— GNU Affero General Public License (AGPL) v. 3
— Open Software License (OSL) v. 2.1, v. 3.0
— Eclipse Public License (EPL) v. 1.0
— CeCILL v. 2.0, v. 2.1
— Mozilla Public Licence (MPL) v. 2
— GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software
— European Union Public Licence (EUPL) v. 1.1, v. 1.2
— Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+).
The European Commission may update this Appendix to later versions of the above licences without producing
a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the
covered Source Code from exclusive appropriation.
All other changes or additions to this Appendix require the production of a new EUPL version.

80
README.md Normal file
View File

@ -0,0 +1,80 @@
<!-- SPDX-FileCopyrightText: 2023-2024 Anna <cyber@sysrq.in> -->
<!-- SPDX-License-Identifier: CC0-1.0 -->
repology-client
===============
[![Build Status](https://drone.tildegit.org/api/badges/CyberTaIlor/python-repology/status.svg)](https://drone.tildegit.org/CyberTaIlor/python-repology)
Asynchronous wrapper for [Repology API][repology-api].
> Note that API stability is currently not guaranteed - it may change at any
> moment.
[repology-api]: https://repology.org/api
Installing
----------
### Gentoo
```sh
eselect repository enable guru
emaint sync -r guru
emerge dev-python/repology-client
```
### Other systems
`pip install repology-client --user`
Packaging
---------
You can track new releases using an [atom feed][atom] provided by GitHub.
[atom]: https://github.com/cybertailor/repology-client/releases.atom
Contributing
------------
Patches and pull requests are welcome. Please use either [git-send-email(1)][1]
or [git-request-pull(1)][2], addressed to <cyber@sysrq.in>.
If you prefer GitHub-style workflow, use the [mirror repo][gh] to send pull
requests.
Your commit message should conform to the following standard:
```
file/changed: Concice and complete statement of the purpose
This is the body of the commit message. The line above is the
summary. The summary should be no more than 72 chars long. The
body can be more freely formatted, but make it look nice. Make
sure to reference any bug reports and other contributors. Make
sure the correct authorship appears.
```
[1]: https://git-send-email.io/
[2]: https://git-scm.com/docs/git-request-pull
[gh]: http://github.com/cybertailor/repology-client
IRC
---
You can join the `#repology-client` channel either on [OFTC][oftc] or
[via Matrix][matrix].
[oftc]: https://www.oftc.net/
[matrix]: https://matrix.to/#/#repology-client:sysrq.in
License
-------
European Union Public License 1.2

0
docs/_static/.gitkeep vendored Normal file
View File

0
docs/_templates/.gitkeep vendored Normal file
View File

78
docs/conf.py Normal file
View File

@ -0,0 +1,78 @@
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2023-2024 Anna <cyber@sysrq.in>
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'repology-client'
author = 'Anna <cyber@sysrq.in>'
copyright = f'2024, {author}'
release = '0.0.1'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'sphinx.ext.autosummary',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx_prompt',
]
try:
import notfound.extension
extensions.append('notfound.extension')
notfound_urls_prefix = None
except ModuleNotFoundError:
pass
try:
import sphinx_sitemap
extensions.append('sphinx_sitemap')
sitemap_locales = [None]
sitemap_url_scheme = '{link}'
except ModuleNotFoundError:
pass
master_doc = 'index'
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
intersphinx_mapping = {
'aiohttp': ('https://docs.aiohttp.org/en/stable', None),
}
autodoc_default_flags = [
'members',
'show-inheritance',
'inherited-members',
'undoc-members',
]
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'aiohttp_theme'
html_permalinks_icon = '#'
html_theme_options = {
'description': 'Asynchronous Python wrapper for Repology API',
'canonical_url': 'https://repology-client.sysrq.in/',
}
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'searchbox.html',
]
}
html_static_path = ['_static']
html_title = f'{project} {release}'
html_baseurl = 'https://repology-client.sysrq.in/'

58
docs/contributing.rst Normal file
View File

@ -0,0 +1,58 @@
.. SPDX-FileCopyrightText: 2023-2024 Anna <cyber@sysrq.in>
.. SPDX-License-Identifier: CC0-1.0
Contributing
============
Any form of contribution is welcome!
Workflow
--------
First, get the source code:
.. prompt:: bash
git clone https://git.sysrq.in/python/repology-client
Make some changes and run the tests and the linters:
.. prompt:: bash
tox run
Commit the changes. Your commit message should conform to the following
standard::
file/changed: concice and complete statement of the purpose
This is the body of the commit message. The line above is the
summary. The summary should be no more than 72 chars long. The
body can be more freely formatted, but make it look nice. Make
sure to reference any bug reports and other contributors. Make
sure the correct authorship appears.
Use `git rebase`_ if needed to make commit history look good.
.. _git rebase: https://git-rebase.io/
Finally, send a patch to the developer using `git send-email`_:
.. prompt:: bash
git send-email --to=cyber@sysrq.in origin/master
.. _git send-email: https://git-send-email.io/
.. note::
If you prefer GitHub-style workflow, use the `mirror repo`_ to send pull
requests.
.. _mirror repo: https://github.com/cybertailor/repology-client
Code style
----------
Whatever the almighty linters say, should be at least `PEP 8`_.
.. _PEP 8: https://peps.python.org/pep-0008/

34
docs/faq.rst Normal file
View File

@ -0,0 +1,34 @@
.. SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
.. SPDX-License-Identifier: CC0-1.0
Imaginary FAQ
=============
.. contents::
:local:
Can this library be replaced by ``requests.get()``?
---------------------------------------------------
Yes, if your search never results in >200 packages.
Why asynchronous?
-----------------
It's what cool kids use nowadays.
Oh, so will you rewrite it in Rust?
-----------------------------------
No, the library is pure Python and will always stay. Although its dependencies
are guaranteed to depend on Rust.
What version policy does the library follow?
--------------------------------------------
`SemVer 2.0.0 <https://semver.org/spec/v2.0.0.html>`_.
What is that EUPL license about? I've never seen it before.
-----------------------------------------------------------
It's like LGPL but much shorter and understandable.

42
docs/getting-started.rst Normal file
View File

@ -0,0 +1,42 @@
.. SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
.. SPDX-License-Identifier: CC0-1.0
Getting Started
===============
Basic example
-------------
Find out which versions projects with "firefox" in their name are packaged at:
.. code-block:: python
import asyncio
import repology_client
async def main():
projects = await repology_client.get_projects(search="firefox")
for proj, packages in projects.items():
for pkg in packages:
print(f"{proj} is packaged in {pkg.repo} at version {pkg.version}")
print("-" * 20)
asyncio.run(main())
Get all Firefox packages as a set:
.. code-block:: python
packages = await repology_client.get_packages(firefox)
Advanced usage
--------------
You can control timeouts and other connection settings by constructing custom
:external:py:class:`aiohttp.ClientSession` objects and passing them to a
function.
If you're making an application that makes bulk requests to Repology API, please
consider setting custom ``User-agent`` header. It usually looks like this::
Mozilla/5.0 (compatible; <botname>/<botversion>; +<boturl>)

68
docs/index.rst Normal file
View File

@ -0,0 +1,68 @@
.. SPDX-FileCopyrightText: 2023-2024 Anna <cyber@sysrq.in>
.. SPDX-License-Identifier: CC0-1.0
Welcome to repology-client
==========================
Asynchronous Python wrapper for `Repology API`_.
.. _Repology API: https://repology.org/api
.. note::
Repology API stability is currently not guaranteed it may change at any
moment.
If you want to learn how and why to use this library, check out the following
resources:
* :doc:`faq`
* :doc:`installation`
* :doc:`getting-started`
If you need help, or want to talk to the developers, use our chat rooms:
* IRC: `#repology-client`_ at ``irc.oftc.net``
* Matrix: `#repology-client:sysrq.in`_
.. _#repology-client: https://kiwiirc.com/nextclient/#ircs://irc.oftc.net:+6697/repology-client
.. _#repology-client\:sysrq.in: https://matrix.to/#/#repology-client:sysrq.in
If you find any bugs, please report them on `Bugzilla`_.
.. _Bugzilla: https://bugs.sysrq.in/enter_bug.cgi?product=Python%20libraries&component=repology-client
Features
--------
The following endpoints are supported:
* ``/api/v1/project/<project>``
* ``/api/v1/projects/``
Need more? Your :doc:`contributions <contributing>` are welcome!
Table of Contents
-----------------
.. toctree::
:caption: Documentation
installation
getting-started
faq
contributing
release-notes
reference
.. toctree::
:caption: External Links
Git Repository <https://git.sysrq.in/python/repology-client>
PyPI Package <https://pypi.org/project/repology-client/>
Indices and tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

38
docs/installation.rst Normal file
View File

@ -0,0 +1,38 @@
.. SPDX-FileCopyrightText: 2023 Anna <cyber@sysrq.in>
.. SPDX-License-Identifier: CC0-1.0
Installation
============
.. note::
This library follows the `Semantic Versioning 2.0.0
<https://semver.org/spec/v2.0.0.html>`_ policy.
Prerequisites
-------------
The following dependencies are used by this library:
* :external+aiohttp:doc:`aiohttp <index>`
* `pydantic`_
.. _pydantic: https://pydantic.dev/
Gentoo
------
gentle is packaged for Gentoo in the GURU ebuild repository.
.. prompt:: bash #
eselect repository enable guru
emaint sync -r guru
emerge dev-python/repology-client
Manual installation
-------------------
.. prompt:: bash
pip install repology-client --user

11
docs/reference.rst Normal file
View File

@ -0,0 +1,11 @@
.. SPDX-FileCopyrightText: 2023 Anna <cyber@sysrq.in>
.. SPDX-License-Identifier: CC0-1.0
API Reference
=============
.. autosummary::
:toctree: api
:recursive:
repology_client

10
docs/release-notes.rst Normal file
View File

@ -0,0 +1,10 @@
.. SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
.. SPDX-License-Identifier: CC0-1.0
Release Notes
=============
0.0.1
-----
* First release

80
pyproject.toml Normal file
View File

@ -0,0 +1,80 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2022-2024 Anna <cyber@sysrq.in>
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "repology-client"
description = "Asynchronous wrapper for Repology API"
authors = [
{name = "Anna", email = "cyber@sysrq.in"}
]
dynamic = ["version"]
readme = "README.md"
license = "EUPL-1.2"
requires-python = ">=3.10"
dependencies = [
"aiohttp<4,>=3",
"pydantic<3,>=2",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Software Distribution",
"Typing :: Typed",
]
keywords = ["repology", "api", "async", "aiohttp"]
[project.optional-dependencies]
test = [
"pytest",
"pytest-asyncio",
"pytest-recording",
]
docs = [
"aiohttp-theme",
"sphinx",
"sphinx-prompt",
]
[project.urls]
Home = "https://repology-client.sysrq.in/"
Source = "https://git.sysrq.in/python/repology-client"
Issues = "https://bugs.sysrq.in/enter_bug.cgi?product=Python libraries&component=repology-client"
Changelog = "https://repology-client.sysrq.in/release-notes.html"
[tool.hatch.version]
path = "repology_client/constants.py"
[tool.hatch.build.targets.sdist]
include = [
"/docs",
"/repology_client",
"/tests"
]
exclude = [
"/docs/api"
]
[tool.pytest.ini_options]
addopts = "--doctest-modules --block-network -p no:vcr"
asyncio_mode = "strict"
[[tool.mypy.overrides]]
module = [
"tests.*",
]
# requiring explicit types for all test methods would be cumbersome
disallow_untyped_defs = false
check_untyped_defs = true
[tool.mypy]
disallow_untyped_defs = true
no_implicit_optional = true

125
repology_client/__init__.py Normal file
View File

@ -0,0 +1,125 @@
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
""" Asynchronous wrapper for Repology API """
import warnings
from pathlib import PurePosixPath
from typing import Any
import aiohttp
from repology_client.constants import API_URL, HARD_LIMIT, MAX_PROJECTS
from repology_client.exceptions import EmptyResponse, InvalidInput
from repology_client.types import Package, ProjectsRange
from repology_client.utils import ensure_session, limit
@limit(calls=1, period=1.0)
async def api(endpoint: str, params: dict | None = None, *,
session: aiohttp.ClientSession | None = None) -> Any:
"""
Do a single API request.
:param endpoint: API endpoint (example: ``/projects``)
:param params: URL query string parameters
:param session: :external+aiohttp:py:module:`aiohttp` client session
:raises repology.exceptions.EmptyResponse: on empty response
:raises aiohttp.ClientResponseError: on HTTP errors
:returns: decoded JSON response
"""
async with ensure_session(session) as aiohttp_session:
async with aiohttp_session.get(API_URL + endpoint,
params=params or {},
raise_for_status=True) as response:
data = await response.json()
if not data:
raise EmptyResponse
return data
async def get_packages(project: str, *,
session: aiohttp.ClientSession | None = None) -> set[Package]:
"""
Access the ``/api/v1/project/<project>`` endpoint to list packages for a
single project.
:param project: project name on Repology
:param session: :external+aiohttp:py:module:`aiohttp` client session
:raises repology.exceptions.EmptyResponse: on empty response
:raises repology.exceptions.InvalidInput: if ``project`` is an empty string
:raises aiohttp.ClientResponseError: on HTTP errors
:returns: set of packages
"""
if not project:
raise InvalidInput(f"Not a valid project name: {project}")
async with ensure_session(session) as aiohttp_session:
endpoint = PurePosixPath("/project") / project
data = await api(str(endpoint), session=aiohttp_session)
return {Package(**package) for package in data}
async def get_projects(start: str = "", end: str = "", count: int = 200, *,
session: aiohttp.ClientSession | None = None,
**filters: Any) -> dict[str, set[Package]]:
"""
Access the ``/api/v1/projects/`` endpoint to list projects.
If both ``start`` and ``end`` are given, only ``start`` is used.
:param start: name of the first project to start with
:param end: name of the last project to end with
:param count: maximum number of projects to fetch
:param session: :external+aiohttp:py:module:`aiohttp` client session
:raises repology.exceptions.EmptyResponse: on empty response
:raises aiohttp.ClientResponseError: on HTTP errors
:returns: project to packages mapping
"""
if count > HARD_LIMIT:
warnings.warn(f"Resetting count to {HARD_LIMIT} to prevent API abuse")
count = HARD_LIMIT
proj_range = ProjectsRange(start, end)
if start and end:
warnings.warn("The 'start..end' range format is not supported by Repology API")
proj_range.end = ""
result: dict[str, set[Package]] = {}
async with ensure_session(session) as aiohttp_session:
while True:
endpoint = PurePosixPath("/projects")
if proj_range:
endpoint /= str(proj_range)
batch = await api(f"{endpoint}/", filters, session=aiohttp_session)
for project in batch:
result[project] = set()
for package in batch[project]:
result[project].add(Package(**package))
if len(result) >= count:
break
if len(batch) == MAX_PROJECTS:
# we probably hit API limits, so…
# …choose lexicographically highest project as a new start
proj_range.start = max(batch)
# …make sure we haven't already hit the end
if proj_range.start >= end:
break
# …and drop end condition as unsupported
proj_range.end = ""
else:
break
return result

View File

@ -0,0 +1,28 @@
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
"""
Hardcoded constants for rapidly-changing Repology API. What could possibly go
wrong?
"""
# Library package name.
PACKAGE = "repology-client"
# Library version.
VERSION = "0.0.1"
# Library homepage.
HOMEPAGE = "https://repology-client.sysrq.in"
# Library's User-agent header
USER_AGENT = f"Mozilla/5.0 (compatible; {PACKAGE}/{VERSION}; +{HOMEPAGE})"
# Base URL for all API requests.
API_URL = "https://repology.org/api/v1"
# Maximum number of projects API can return.
MAX_PROJECTS = 200
# Number of projects, starting from which you should use bulk export instead.
HARD_LIMIT = 5_000

View File

@ -0,0 +1,23 @@
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
""" Exceptions this library can raise. """
class RepologyException(Exception):
"""
Base class for all our exceptions. Pinkie promise.
"""
class InvalidInput(RepologyException):
"""
A function was given invalid parameters.
"""
class EmptyResponse(RepologyException):
"""
Raised if API returned empty object. Is it an error or everything's correct,
just nothing matched your search criteria? Who knows.
"""

0
repology_client/py.typed Normal file
View File

58
repology_client/types.py Normal file
View File

@ -0,0 +1,58 @@
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
""" Type definitions for Repology API, implemented as Pydantic models. """
from pydantic.dataclasses import dataclass
@dataclass
class ProjectsRange:
"""
Object for constructing a string representation of range.
>>> str(ProjectsRange())
''
>>> str(ProjectsRange(start="firefox"))
'firefox'
>>> str(ProjectsRange(end="firefox"))
'..firefox'
>>> str(ProjectsRange(start="firefox", end="firefoxpwa"))
'firefox..firefoxpwa'
"""
start: str = ""
end: str = ""
def __bool__(self) -> bool:
return bool(self.start or self.end)
def __str__(self) -> str:
if self.end:
return f"{self.start}..{self.end}"
if self.start:
return self.start
return ""
@dataclass(frozen=True)
class Package:
"""
Package description type returned by ``/api/v1/projects/`` endpoint.
"""
# Required fields
repo: str
visiblename: str
version: str
status: str
# Optional fields
subrepo: str | None = None
srcname: str | None = None
binname: str | None = None
origversion: str | None = None
summary: str | None = None
categories: frozenset[str] | None = None
licenses: frozenset[str] | None = None
maintainers: frozenset[str] | None = None

79
repology_client/utils.py Normal file
View File

@ -0,0 +1,79 @@
# SPDX-License-Identifier: EUPL-1.2 AND CC-BY-SA-3.0
# SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
# SPDX-FileCopyrightText: 2017 Mark Amery <markrobertamery@gmail.com>
""" Utility functions and classes. """
import asyncio
import time
from collections.abc import AsyncGenerator, Callable
from contextlib import asynccontextmanager
from typing import Any
import aiohttp
from repology_client.constants import USER_AGENT
class limit():
"""
Based on `this StackOverflow answer
<https://stackoverflow.com/questions/35196974/aiohttp-set-maximum-number-of-requests-per-second/62503115>`_.
Set a limit on requests per second.
"""
def __init__(self, calls: int, period: float):
"""
:param calls: number of calls
:param period: time period in seconds
"""
self.calls: int = calls
self.period: float = period
self.clock: Callable[[], float] = time.monotonic
self.last_reset: float = 0.0
self.num_calls: int = 0
def __call__(self, func: Callable) -> Callable:
async def wrapper(*args: Any, **kwargs: Any) -> Callable:
if self.num_calls >= self.calls:
await asyncio.sleep(self.__period_remaining())
period_remaining = self.__period_remaining()
if period_remaining <= 0:
self.num_calls = 0
self.last_reset = self.clock()
self.num_calls += 1
return await func(*args, **kwargs)
return wrapper
def __period_remaining(self) -> float:
elapsed = self.clock() - self.last_reset
return self.period - elapsed
@asynccontextmanager
async def ensure_session(
session: aiohttp.ClientSession | None = None
) -> AsyncGenerator[aiohttp.ClientSession, None]:
"""
Create a new client session, if necessary, and close it on exit.
:param session: :external+aiohttp:py:module:`aiohttp` client session
"""
keep_session = True
if session is None:
timeout = aiohttp.ClientTimeout(total=30)
headers = {"user-agent": USER_AGENT}
session = aiohttp.ClientSession(headers=headers, timeout=timeout)
keep_session = False
yield session
if not keep_session:
await session.close()

0
tests/__init__.py Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
interactions:
- request:
body: null
headers: {}
method: GET
uri: https://repology.org/api/v1/project/79c603a2a2c65e868f369a1a16769077
response:
body:
string: '[]'
headers:
Cache-Control:
- max-age=3600
Connection:
- keep-alive
Content-Length:
- '2'
Content-Security-Policy:
- default-src 'none'; style-src 'self'; script-src 'self'; img-src 'self'; font-src
'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'
Content-Type:
- application/json
Date:
- Sat, 06 Jan 2024 20:55:56 GMT
Expires:
- Sat, 06 Jan 2024 21:55:56 GMT
Permissions-Policy:
- interest-cohort=()
Referrer-Policy:
- unsafe-url
Server:
- nginx
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Vary:
- Accept-Encoding, Cookie
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
status:
code: 200
message: OK
version: 1

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,43 @@
interactions:
- request:
body: null
headers: {}
method: GET
uri: https://repology.org/api/v1/projects/?search=79c603a2a2c65e868f369a1a16769077
response:
body:
string: '{}'
headers:
Cache-Control:
- max-age=3600
Connection:
- keep-alive
Content-Length:
- '2'
Content-Security-Policy:
- default-src 'none'; style-src 'self'; script-src 'self'; img-src 'self'; font-src
'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'
Content-Type:
- application/json
Date:
- Sat, 06 Jan 2024 20:56:01 GMT
Expires:
- Sat, 06 Jan 2024 21:56:01 GMT
Permissions-Policy:
- interest-cohort=()
Referrer-Policy:
- unsafe-url
Server:
- nginx
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Vary:
- Accept-Encoding, Cookie
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
status:
code: 200
message: OK
version: 1

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

15
tests/conftest.py Normal file
View File

@ -0,0 +1,15 @@
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
from collections.abc import AsyncGenerator
import aiohttp
import pytest_asyncio
@pytest_asyncio.fixture(scope="session")
async def session() -> AsyncGenerator[aiohttp.ClientSession, None]:
timeout = aiohttp.ClientTimeout(total=30)
test_session = aiohttp.ClientSession(timeout=timeout)
yield test_session
await test_session.close()

77
tests/test_client.py Normal file
View File

@ -0,0 +1,77 @@
# SPDX-License-Identifier: EUPL-1.2
# SPDX-FileCopyrightText: 2024 Anna <cyber@sysrq.in>
import uuid
import aiohttp
import pytest
import repology_client
from repology_client.exceptions import EmptyResponse, InvalidInput
from repology_client.types import Package
@pytest.mark.vcr
@pytest.mark.asyncio(scope="session")
async def test_get_packages_empty(session: aiohttp.ClientSession) -> None:
with pytest.raises(InvalidInput):
await repology_client.get_packages("", session=session)
@pytest.mark.vcr
@pytest.mark.asyncio(scope="session")
async def test_get_packages_notfound(session: aiohttp.ClientSession) -> None:
with pytest.raises(EmptyResponse):
project = uuid.uuid5(uuid.NAMESPACE_DNS, "repology.org").hex
await repology_client.get_packages(project, session=session)
@pytest.mark.vcr
@pytest.mark.asyncio(scope="session")
async def test_get_packages(session: aiohttp.ClientSession) -> None:
packages = await repology_client.get_packages("firefox", session=session)
firefox_pkg: Package | None = None
for pkg in packages:
if pkg.repo == "gentoo" and pkg.visiblename == "www-client/firefox":
firefox_pkg = pkg
break
assert firefox_pkg is not None
assert firefox_pkg.srcname == "www-client/firefox"
assert firefox_pkg.summary == "Firefox Web Browser"
assert firefox_pkg.maintainers is not None
assert "mozilla@gentoo.org" in firefox_pkg.maintainers
assert firefox_pkg.licenses is not None
assert "MPL-2.0" in firefox_pkg.licenses
@pytest.mark.vcr
@pytest.mark.asyncio(scope="session")
async def test_get_projects_simple(session: aiohttp.ClientSession) -> None:
projects = await repology_client.get_projects(count=200, session=session)
assert len(projects) == 200
@pytest.mark.vcr
@pytest.mark.asyncio(scope="session")
async def test_get_projects_start_and_end(session: aiohttp.ClientSession) -> None:
with pytest.warns(UserWarning):
await repology_client.get_projects("a", "b", session=session)
@pytest.mark.vcr
@pytest.mark.asyncio(scope="session")
async def test_get_projects_search_failed(session: aiohttp.ClientSession) -> None:
with pytest.raises(EmptyResponse):
project = uuid.uuid5(uuid.NAMESPACE_DNS, "repology.org").hex
await repology_client.get_projects(search=project, session=session)
@pytest.mark.vcr
@pytest.mark.asyncio(scope="session")
async def test_get_projects_search(session: aiohttp.ClientSession) -> None:
projects = await repology_client.get_projects(search="firefox", session=session)
assert "firefox" in projects

32
tox.ini Normal file
View File

@ -0,0 +1,32 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2023-2024 Anna <cyber@sysrq.in>
[tox]
minversion = 4.0
env_list = py3{10,11}, lint
[testenv]
description = run the tests
deps =
mypy
types-setuptools
extras =
test
commands =
pytest -vv {tty:--color=yes} {posargs}
mypy repology_client tests
[testenv:lint]
description = run the linters
skip_install = true
deps =
pycodestyle
pyflakes
reuse
commands =
reuse lint
pyflakes {posargs:repology_client tests}
pycodestyle {posargs:repology_client tests}
[pycodestyle]
max-line-length = 100