├── .bumpversion.cfg
├── .github
└── workflows
│ ├── lint.yml
│ ├── publish.yml
│ └── test.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yml
├── LICENSE
├── README.md
├── docs
├── Makefile
├── README.md
├── conf.py
├── index.rst
├── make.bat
├── nextinspace.rst
└── requirements.txt
├── img
├── demo.cast
└── demo.svg
├── nextinspace
├── __init__.py
├── __main__.py
└── cli
│ ├── __init__.py
│ ├── console.py
│ ├── parser.py
│ └── viewer.py
├── poetry.lock
├── pyproject.toml
└── tests
├── cli
└── test_viewer.py
├── conftest.py
├── data
├── event.json
├── launch.json
└── launcher.json
└── test_nextinspace.py
/.bumpversion.cfg:
--------------------------------------------------------------------------------
1 | [bumpversion]
2 | current_version = 3.0.1
3 | commit = True
4 | tag = True
5 | sign_tags = True
6 |
7 | [bumpversion:file:nextinspace/__init__.py]
8 |
9 | [bumpversion:file:pyproject.toml]
10 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Lint
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 | strategy:
9 | matrix:
10 | python-version: [3.11]
11 |
12 | steps:
13 | - uses: actions/checkout@v2
14 |
15 | - name: Set up Python ${{ matrix.python-version }}
16 | uses: actions/setup-python@v2
17 | with:
18 | python-version: ${{ matrix.python-version }}
19 |
20 | - name: Install dependencies
21 | run: |
22 | python -m pip install --upgrade pip
23 | python -m pip install --upgrade pre-commit
24 |
25 | - name: Lint
26 | run: pre-commit run --all-files --show-diff-on-failure
27 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish
2 |
3 | on:
4 | release:
5 | types: [created]
6 |
7 | jobs:
8 | deploy:
9 | runs-on: ubuntu-latest
10 |
11 | steps:
12 | - uses: actions/checkout@v2
13 |
14 | - name: Set up Python
15 | uses: actions/setup-python@v2
16 | with:
17 | python-version: "3.x"
18 |
19 | - name: Install dependencies
20 | run: |
21 | python -m pip install --upgrade pip
22 | python -m pip install poetry
23 |
24 | - name: Build and publish
25 | env:
26 | POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
27 | run: poetry publish --build -v
28 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 | strategy:
9 | fail-fast: false
10 | matrix:
11 | python-version: ["3.10", "3.11", "3.12", "3.13"]
12 |
13 | steps:
14 | - uses: actions/checkout@v2
15 |
16 | - name: Set up Python ${{ matrix.python-version }}
17 | uses: actions/setup-python@v2
18 | with:
19 | python-version: ${{ matrix.python-version }}
20 |
21 | - name: Install dependencies
22 | run: |
23 | python -m pip install --upgrade pip
24 | python -m pip install poetry
25 | poetry install -v
26 |
27 | - name: Unit tests
28 | run: |
29 | poetry run coverage run -m pytest -vv
30 |
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Virtualenvwrapper
2 | .project
3 |
4 | # Vscode
5 | .vscode/
6 |
7 | # Python
8 | __pycache__
9 | nextinspace.egg-info
10 | build/
11 | dist/
12 |
13 | # Pytest
14 | .pytest_cache
15 |
16 | # Docs
17 | docs/_build
18 |
19 | # Coverage
20 | .coverage
21 | coverage.*
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | repos:
2 | - repo: https://github.com/psf/black
3 | rev: 24.10.0
4 | hooks:
5 | - id: black
6 | - repo: https://github.com/PyCQA/isort
7 | rev: 5.13.2
8 | hooks:
9 | - id: isort
10 | - repo: https://github.com/pre-commit/pre-commit-hooks
11 | rev: v5.0.0
12 | hooks:
13 | - id: check-json
14 | - id: check-toml
15 | - id: check-yaml
16 | - repo: https://github.com/pappasam/toml-sort
17 | rev: v0.24.2
18 | hooks:
19 | - id: toml-sort
20 | args: ["--in-place"]
21 | exclude: docs/
22 |
--------------------------------------------------------------------------------
/.readthedocs.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 |
3 | sphinx:
4 | configuration: docs/conf.py
5 | python:
6 | version: 3.8
7 | install:
8 | - requirements: docs/requirements.txt
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nextinspace
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | > *“Never miss a launch.”*
14 |
15 | ## Overview
16 |
17 | A command-line tool for seeing the latest in space. Nextinspace also supports use as a Python library, so you can integrate it into your application. You can also get data printed to the terminal in JSON, which can be piped into another program.
18 |
19 |
22 |
23 | ## Features
24 |
25 | - **Get the next *n* items:** Nextinspace by default prints the closest upcoming item, but you can request as many items as the [LL2 API](https://thespacedevs.com/llapi)
26 | will provide.
27 |
28 | - **Filter by type:** Nextinspace allows you to filter upcoming-related by type. You can choose to only see `launches`, only see `events`, or both.
29 |
30 | - **Toggle the verbosity:** Nextinspace offers quiet, normal, and verbose modes. With `--quiet`, you can get a quick overview of upcoming items.
31 | With `--verbose`, you can see all of the important details such as description and launcher.
32 |
33 | - **JSON output:** Nextinspace provides a `--json` flag for output in JSON format. This can be parsed with tools like [`jq`](https://github.com/stedolan/jq).
34 |
35 | - **Pretty printing:** Nextinspace prints upcoming items in formatted panels and with colored text.
36 |
37 |
38 |
39 |
40 |
41 | ## Installation and Documentation
42 |
43 | Nextinspace can be installed using `pip`:
44 |
45 | ```bash
46 | pip install nextinspace
47 | ```
48 |
49 | It can also be installed directly from Github:
50 |
51 | ```bash
52 | pip install git+https://github.com/gideonshaked/nextinspace
53 | ```
54 |
55 | Or you can use your favorite package manager:
56 |
57 | ```bash
58 | # Arch Linux
59 | yay -S nextinspace
60 |
61 | # Nix
62 | nix-env -iA nixpkgs.nextinspace
63 | ```
64 |
65 | Documentation can be found at [Read the Docs](https://nextinspace.readthedocs.io).
66 |
67 | ## Using the Nextinspace Public API
68 |
69 | Nextinspace defines a [public API](https://nextinspace.readthedocs.io/en/stable/nextinspace.html) of functions and classes that you can use in your code.
70 |
71 | ```python
72 | >>> import nextinspace
73 | ```
74 |
75 | ### Example 1: Get the next upcoming space-related thing
76 |
77 | ```python
78 | >>> next_in_space = nextinspace.nextinspace(1)
79 | >>> next_in_space
80 | (nextinspace.Event('Starship SN9 Pressure Test', 'Boca Chica, Texas', datetime.datetime(2020, 12, 28, 21, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'SpaceX has conducted a pressure test on Starship SN9.', 'Ambient Pressure Test'),)
81 | >>> print(next_in_space[0].date)
82 | 2020-12-28 21:00:00-05:00
83 | ```
84 |
85 | ### Example 2: Get the next two upcoming events
86 |
87 | ```python
88 | >>> next_2_events = nextinspace.next_event(2)
89 | >>> next_2_events
90 | (nextinspace.Event('Starship SN9 Pressure Test', 'Boca Chica, Texas', datetime.datetime(2020, 12, 28, 21, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'SpaceX has conducted a pressure test on Starship SN9.', 'Ambient Pressure Test'), nextinspace.Event('Starship SN9 Cryoproof Test', 'Boca Chica, Texas', datetime.datetime(2020, 12, 29, 18, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'SpaceX will likely conduct a cryoproof test on Starship SN9. This is the first cryo test performed on the vehicle.', 'Cryoproof Test'))
91 | >>> next_2_events[1].name
92 | 'Starship SN9 Cryoproof Test'
93 | ```
94 |
95 | ### Example 3: Get the next upcoming launch
96 |
97 | ```python
98 | >>> next_space_launch = nextinspace.next_launch(1)
99 | >>> next_space_launch
100 | (nextinspace.Launch('Soyuz STA/Fregat | CSO-2', 'Soyuz Launch Complex, Kourou, French Guiana', datetime.datetime(2020, 12, 29, 11, 42, 7, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'The CSO-2 (Composante Spatiale Optique-2) satellite is the second of three new-generation high-resolution optical imaging satellites for the French military, replacing the Helios 2 spy satellite series.', 'Government/Top Secret', None),)
101 | >>> print(next_space_launch[0].launcher)
102 | None
103 | ```
104 |
105 | ### Example 4: Get the next two upcoming launches and their launchers
106 |
107 | ```python
108 | >>> next_2_launches = nextinspace.next_launch(2, include_launcher=True)
109 | >>> next_2_launches
110 | (nextinspace.Launch('Soyuz STA/Fregat | CSO-2', 'Soyuz Launch Complex, Kourou, French Guiana', datetime.datetime(2020, 12, 29, 11, 42, 7, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'The CSO-2 (Composante Spatiale Optique-2) satellite is the second of three new-generation high-resolution optical imaging satellites for the French military, replacing the Helios 2 spy satellite series.', 'Government/Top Secret', nextinspace.Launcher('Soyuz STA/Fregat', 7020, 2810, None, 312, 3, 46.3, 8, 8, 0, datetime.datetime(2011, 12, 16, 19, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')))), nextinspace.Launch('Falcon 9 Block 5 | Türksat 5A', 'Space Launch Complex 40, Cape Canaveral, FL, USA', datetime.datetime(2021, 1, 4, 20, 27, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'Türksat 5A is the first of two Turkish next generation communications satellites, which will be operated by Türksat for commercial and military purposes.', 'Communications', nextinspace.Launcher('Falcon 9 Block 5', 22800, 8300, 7607, 549, 2, 70.0, 47, 47, 0, datetime.datetime(2018, 5, 10, 20, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000), 'EDT')))))
111 | >>> next_2_launches[0].launcher.failed_launches
112 | 0
113 | ```
114 |
115 | ## Using Nextinspace in Shell Scripting
116 |
117 | Nextinspace is capable of outputting structured JSON data that can be parsed by the likes of [`jq`](https://github.com/stedolan/jq). As such, you can do something like this:
118 |
119 | ```bash
120 | ❯ next_3_in_space=$(nextinspace 3 --verbose --json)
121 | ❯ echo $next_3_in_space | jq "."
122 | [
123 | {
124 | "type": "launch",
125 | "name": "Soyuz STA/Fregat | CSO-2",
126 | "location": "Soyuz Launch Complex, Kourou, French Guiana",
127 | "date": "2020-12-29T16:42:07Z",
128 | "description": "The CSO-2 (Composante Spatiale Optique-2) satellite is the second of three new-generation high-resolution optical imaging satellites for the French military, replacing the Helios 2 spy satellite series.",
129 | "subtype": "Government/Top Secret",
130 | "launcher": {
131 | "name": "Soyuz STA/Fregat",
132 | "payload_leo": 7020,
133 | "payload_gto": 2810,
134 | "liftoff_thrust": null,
135 | "liftoff_mass": 312,
136 | "max_stages": 3,
137 | "height": 46.3,
138 | "successful_launches": 8,
139 | "consecutive_successful_launches": 8,
140 | "failed_launches": 0,
141 | "maiden_flight_date": "2011-12-17"
142 | }
143 | },
144 | {
145 | "type": "event",
146 | "name": "Starship SN9 Cryoproof Test",
147 | "location": "Boca Chica, Texas",
148 | "date": "2020-12-29T23:00:00Z",
149 | "description": "SpaceX will likely conduct a cryoproof test on Starship SN9. This is the first cryo test performed on the vehicle.",
150 | "subtype": "Cryoproof Test"
151 | },
152 | {
153 | "type": "event",
154 | "name": "SLS Green Run Hot Fire",
155 | "location": "Stennis Space Center, Mississippi",
156 | "date": "2020-12-31T00:00:00Z",
157 | "description": "The core stage of the Space Launch System will undergo the final 'Green Run' test, where the core stage will be fired for 8 minutes, demonstrating performance similar to an actual launch.",
158 | "subtype": "Static Fire"
159 | }
160 | ]
161 | ❯ echo $next_3_in_space | jq ".[].name"
162 | "Soyuz STA/Fregat | CSO-2"
163 | "Starship SN9 Cryoproof Test"
164 | "SLS Green Run Hot Fire"
165 | ```
166 |
167 | The structure of the JSON outputted by nextinspace is basically demonstrated in the example above.
168 | The structure and values of the data reflect the relationships between the `Launch`, `Event`, and `Launcher` classes, with a few notable exceptions:
169 |
170 | - **The `type_` attribute:** The `type_` attribute of Nextinspace `Event` and `Launch` objects is stored in the `subtype` key. The `type` key actually holds the class of the Nextinspace object represented in the JSON object (either `launch` or `event`).
171 | - **The `date` key:** Internally, Nextinspace stores dates and times in local time, but for JSON output Nextinspace converts date and time values to UTC. Also, Nextinspace outputs date and time values in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html).
172 |
173 | ## CLI Reference
174 |
175 | ```
176 | ❯ nextinspace --help
177 | usage: nextinspace [-h] [-e | -l] [-v | -q] [--json] [--version] [number of items]
178 |
179 | Never miss a launch.
180 |
181 | positional arguments:
182 | number of items The number of items to display.
183 |
184 | optional arguments:
185 | -h, --help show this help message and exit
186 | -e, --events-only Only show events. These are typically not covered by standard launches. These events could be spacecraft landings, engine tests, or spacewalks.
187 | -l, --launches-only Only display orbital and suborbital launches. Generally these will be all orbital launches and suborbital launches which aim to reach “space” or the Karman line.
188 | -v, --verbose Display additional details about launches.
189 | -q, --quiet Only display name, location, date, and type.
190 | --json Output data in JSON format. Note that '--quiet' has no effect when this flag is set.
191 | --version show program's version number and exit
192 | ```
193 |
194 | ## Credits
195 |
196 | This project would not have been possible without the [Launch Library 2 API](https://thespacedevs.com/llapi). Please consider [sponsoring them on Patreon](https://www.patreon.com/TheSpaceDevs).
197 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line, and also
5 | # from the environment for the first two.
6 | SPHINXOPTS ?=
7 | SPHINXBUILD ?= sphinx-build
8 | SOURCEDIR = .
9 | BUILDDIR = _build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | ../README.md
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | # Configuration file for the Sphinx documentation builder.
2 | #
3 | # This file only contains a selection of the most common options. For a full
4 | # list see the documentation:
5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
6 |
7 | # -- Path setup --------------------------------------------------------------
8 |
9 | # If extensions (or modules to document with autodoc) are in another directory,
10 | # add these directories to sys.path here. If the directory is relative to the
11 | # documentation root, use os.path.abspath to make it absolute, like shown here.
12 | #
13 | import os
14 | import sys
15 |
16 | sys.path.insert(0, os.path.abspath(".."))
17 |
18 | import nextinspace
19 |
20 |
21 | # -- Project information -----------------------------------------------------
22 |
23 | project = "Nextinspace"
24 | copyright = "2020, Gideon Shaked"
25 | author = "Gideon Shaked"
26 | version = nextinspace.__version__
27 | release = nextinspace.__version__
28 |
29 |
30 | # -- General configuration ---------------------------------------------------
31 |
32 | # Add any Sphinx extension module names here, as strings. They can be
33 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
34 | # ones.
35 |
36 | import sphinx_rtd_theme
37 |
38 | extensions = [
39 | "sphinx.ext.autodoc",
40 | "recommonmark",
41 | "sphinx_rtd_theme",
42 | "sphinx.ext.viewcode",
43 | ]
44 |
45 | source_suffix = [".rst", ".md"]
46 |
47 | # Add any paths that contain templates here, relative to this directory.
48 | templates_path = ["_templates"]
49 |
50 | # List of patterns, relative to source directory, that match files and
51 | # directories to ignore when looking for source files.
52 | # This pattern also affects html_static_path and html_extra_path.
53 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
54 |
55 |
56 | # -- Options for HTML output -------------------------------------------------
57 |
58 | # The theme to use for HTML and HTML Help pages. See the documentation for
59 | # a list of builtin themes.
60 | #
61 | html_theme = "sphinx_rtd_theme"
62 | html_theme_options = {"collapse_navigation": False}
63 |
64 | # Add any paths that contain custom static files (such as style sheets) here,
65 | # relative to this directory. They are copied after the builtin static files,
66 | # so a file named "default.css" will overwrite the builtin "default.css".
67 | html_static_path = ["_static"]
68 |
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | .. Nextinspace documentation master file, created by
2 | sphinx-quickstart on Sun Dec 27 12:27:59 2020.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Table of Contents
7 | =================
8 |
9 | .. toctree::
10 | :caption: Overview
11 | :maxdepth: 2
12 |
13 | README
14 |
15 | .. toctree::
16 | :caption: Public API
17 |
18 | nextinspace
19 |
20 | Usage & Distribution
21 | ---------------------
22 | * Source is available on the `Github Project Page `_.
23 | * Nextinspace is distributed under the `GNU GPLv3 `_.
--------------------------------------------------------------------------------
/docs/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | pushd %~dp0
4 |
5 | REM Command file for Sphinx documentation
6 |
7 | if "%SPHINXBUILD%" == "" (
8 | set SPHINXBUILD=sphinx-build
9 | )
10 | set SOURCEDIR=.
11 | set BUILDDIR=_build
12 |
13 | if "%1" == "" goto help
14 |
15 | %SPHINXBUILD% >NUL 2>NUL
16 | if errorlevel 9009 (
17 | echo.
18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19 | echo.installed, then set the SPHINXBUILD environment variable to point
20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
21 | echo.may add the Sphinx directory to PATH.
22 | echo.
23 | echo.If you don't have Sphinx installed, grab it from
24 | echo.http://sphinx-doc.org/
25 | exit /b 1
26 | )
27 |
28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29 | goto end
30 |
31 | :help
32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33 |
34 | :end
35 | popd
36 |
--------------------------------------------------------------------------------
/docs/nextinspace.rst:
--------------------------------------------------------------------------------
1 |
2 | :mod:`nextinspace`
3 | ----------------------------------------
4 | .. automodule:: nextinspace
5 | :members: nextinspace, next_launch, next_event, Launch, Launcher, Event
6 | :show-inheritance:
--------------------------------------------------------------------------------
/docs/requirements.txt:
--------------------------------------------------------------------------------
1 | sphinx==3.4.1
2 | recommonmark==0.7.1
3 | sphinx_rtd_theme==0.5.0
--------------------------------------------------------------------------------
/img/demo.cast:
--------------------------------------------------------------------------------
1 | {"version": 2, "width": 90, "height": 52}
2 | [0.0, "o", "\u001b]0;gideon@gideon-laptop: ~\u0007\u001b[01;32mgideon@gideon-laptop\u001b[00m:\u001b[01;34m~\u001b[00m$ "]
3 | [0.699308, "o", "n"]
4 | [0.770996, "o", "e"]
5 | [0.979228, "o", "x"]
6 | [1.355258, "o", "t"]
7 | [1.443131, "o", "i"]
8 | [1.490858, "o", "n"]
9 | [1.603138, "o", "s"]
10 | [1.723065, "o", "p"]
11 | [1.83432, "o", "a"]
12 | [2.011186, "o", "c"]
13 | [2.139203, "o", "e"]
14 | [2.835211, "o", "\r\n"]
15 | [19.567636, "o", "┌────────────────────────────────────────────────────────────────────────────────────────┐\r\n"]
16 | [19.567904, "o", "│\u001b[1m\u001b[36mSoyuz 2.1a | Soyuz MS-17 \u001b[0m│\r\n│\u001b[36m31/6, Baikonur Cosmodrome, Republic of Kazakhstan \u001b[39m│\r\n│ │\r\n│\u001b[32m Wed October 14, 2020 05:45 AM EDT \u001b[39m│\r\n│ Launch Type: Human Exploration │\r\n│ │\r\n"]
17 | [19.568581, "o", "│ Soyuz MS-17 begins expedition 63 by carrying Roscosmos cosmonauts Sergey Ryzhikov, │\r\n│ Sergey Kud-Sverchkov and NASA astronaut Kathleen Rubins to the International Space │\r\n│ Station aboard the Soyuz spacecraft from the Baikonur Cosmodrome in Kazakhstan. │\r\n│ After launching from the Baikonur Cosmodrome in Kazakhstan, they will rendezvous to │\r\n│ the station where they will remain for their 6 month stay. │\r\n└────────────────────────────────────────────────────────────────────────────────────────┘\r\n"]
18 | [19.601865, "o", "\u001b]0;gideon@gideon-laptop: ~\u0007\u001b[01;32mgideon@gideon-laptop\u001b[00m:\u001b[01;34m~\u001b[00m$ "]
19 | [20.507221, "o", "c"]
20 | [20.699198, "o", "l"]
21 | [20.843124, "o", "e"]
22 | [21.059133, "o", "a"]
23 | [21.219153, "o", "r"]
24 | [22.155136, "o", "\r\n"]
25 | [22.158039, "o", "\u001b[H\u001b[2J\u001b[3J"]
26 | [22.158578, "o", "\u001b]0;gideon@gideon-laptop: ~\u0007\u001b[01;32mgideon@gideon-laptop\u001b[00m:\u001b[01;34m~\u001b[00m$ "]
27 | [23.445416, "o", "nextinspace --events-only --quiet 3"]
28 | [24.770444, "o", "\r\n"]
29 | [30.451258, "o", "┌────────────────────────────────────────────────────────────────────────────────────────┐\r\n"]
30 | [30.451401, "o", "│\u001b[1m\u001b[36mSoyuz MS-17 Docking \u001b[0m│\r\n│\u001b[36mInternational Space Station \u001b[39m│\r\n│ │\r\n│\u001b[32m Wed October 14, 2020 08:50 AM EDT \u001b[39m│\r\n│ Event Type: Docking │\r\n├────────────────────────────────────────────────────────────────────────────────────────┤\r\n"]
31 | [30.451532, "o", "│\u001b[1m\u001b[36mBepiColombo’s first Venus flyby \u001b[0m│\r\n│\u001b[36mVenus \u001b[39m│\r\n│ │\r\n"]
32 | [30.451643, "o", "│\u001b[32m Thu October 15, 2020 03:58 AM EDT \u001b[39m│\r\n│ Event Type: Flyby │\r\n├────────────────────────────────────────────────────────────────────────────────────────┤\r\n"]
33 | [30.451737, "o", "│\u001b[1m\u001b[36mISS Expedition 63-64 Change of Command Ceremony \u001b[0m│\r\n│\u001b[36mInternational Space Station \u001b[39m│\r\n│ │\r\n│\u001b[32m Tue October 20, 2020 12:00 AM EDT \u001b[39m│\r\n│ Event Type: Change of Command │\r\n"]
34 | [30.45184, "o", "└────────────────────────────────────────────────────────────────────────────────────────┘\r\n"]
35 | [30.464426, "o", "\u001b]0;gideon@gideon-laptop: ~\u0007\u001b[01;32mgideon@gideon-laptop\u001b[00m:\u001b[01;34m~\u001b[00m$ "]
36 | [34.179317, "o", "c"]
37 | [34.482926, "o", "l"]
38 | [34.643057, "o", "e"]
39 | [34.859114, "o", "a"]
40 | [35.082273, "o", "r"]
41 | [35.547073, "o", "\r\n"]
42 | [35.549847, "o", "\u001b[H\u001b[2J\u001b[3J"]
43 | [35.550428, "o", "\u001b]0;gideon@gideon-laptop: ~\u0007\u001b[01;32mgideon@gideon-laptop\u001b[00m:\u001b[01;34m~\u001b[00m$ "]
44 | [37.047098, "o", "nextinspace --launches-only --verbose 2"]
45 | [38.667119, "o", "\r\n"]
46 | [55.024445, "o", "┌────────────────────────────────────────────────────────────────────────────────────────┐\r\n"]
47 | [55.024673, "o", "│\u001b[1m\u001b[36mSoyuz 2.1a | Soyuz MS-17 \u001b[0m│\r\n│\u001b[36m31/6, Baikonur Cosmodrome, Republic of Kazakhstan \u001b[39m│\r\n│ │\r\n│\u001b[32m Wed October 14, 2020 05:45 AM EDT \u001b[39m│\r\n│ Launch Type: Human Exploration │\r\n│ │\r\n│ ┌───────────────────────────────────────────────────────────┐ │\r\n│ │ Soyuz 2.1A │ │\r\n"]
48 | [55.024861, "o", "│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Height: 46.3 m │ Mass to LEO: 7020 kg │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Max Stages: 3 │ Liftoff Thrust: 4149 kN │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Mass to GTO: 2810 kg │ Liftoff Mass: 312 Tonnes │ │\r\n│ ├───────────────"]
49 | [55.025195, "o", "────────────────────────────────────────────┤ │\r\n│ │ Launch Successes: 20 │ Maiden Flight: 2004-11-04 │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Consecutive Successes: 15 │ Failed Launches: 1 │ │\r\n│ └───────────────────────────────────────────────────────────┘ │\r\n│ │\r\n"]
50 | [55.025351, "o", "│ Soyuz MS-17 begins expedition 63 by carrying Roscosmos cosmonauts Sergey Ryzhikov, │\r\n│ Sergey Kud-Sverchkov and NASA astronaut Kathleen Rubins to the International Space │\r\n"]
51 | [55.025462, "o", "│ Station aboard the Soyuz spacecraft from the Baikonur Cosmodrome in Kazakhstan. │\r\n│ After launching from the Baikonur Cosmodrome in Kazakhstan, they will rendezvous to │\r\n│ the station where they will remain for their 6 month stay. │\r\n├────────────────────────────────────────────────────────────────────────────────────────┤\r\n"]
52 | [55.025567, "o", "│\u001b[1m\u001b[36mLong March 6 | Satellogic x 13 \u001b[0m│\r\n│\u001b[36mLaunch Complex 16, Taiyuan, People's Republic of China \u001b[39m│\r\n│ │\r\n"]
53 | [55.02566, "o", "│\u001b[32m Thu October 15, 2020 12:00 AM EDT \u001b[39m│\r\n│ Launch Type: Earth Science │\r\n│ │\r\n│ ┌───────────────────────────────────────────────────────────┐ │\r\n"]
54 | [55.025768, "o", "│ │ Long March 6 │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Height: 29.0 m │ Mass to LEO: Unavailable │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Max Stages: 3 │ Liftoff Thrust: Unavailable │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n"]
55 | [55.025886, "o", "│ │ Mass to GTO: Unavailable │ Liftoff Mass: 103 Tonnes │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Launch Successes: 3 │ Maiden Flight: Unavailable │ │\r\n│ ├───────────────────────────────────────────────────────────┤ │\r\n│ │ Consecutive Successes: 3 │ Failed Launches: 0 │ │\r\n│ └───────────────────────────────────────────────────────────┘ │\r\n"]
56 | [55.026018, "o", "│ │\r\n"]
57 | [55.026102, "o", "│ First batch of remote sensing satellites for Satellogic's constellation. │\r\n└────────────────────────────────────────────────────────────────────────────────────────┘\r\n"]
58 | [55.047924, "o", "\u001b]0;gideon@gideon-laptop: ~\u0007\u001b[01;32mgideon@gideon-laptop\u001b[00m:\u001b[01;34m~\u001b[00m$ "]
59 | [57.186132, "o", "exit\r\n"]
60 |
--------------------------------------------------------------------------------
/img/demo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nextinspace/__init__.py:
--------------------------------------------------------------------------------
1 | __version__ = "3.0.1"
2 | __all__ = ["nextinspace", "next_launch", "next_event"]
3 |
4 | import typing
5 | from datetime import MINYEAR, datetime, timezone
6 | from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
7 |
8 | import requests
9 |
10 | BASE_URL = "https://ll.thespacedevs.com/2.1.0"
11 |
12 |
13 | class Event:
14 | """Generic space event.
15 |
16 | This constructor is meant for private use. This class is documented solely for its attributes.
17 |
18 | .. note::
19 |
20 | When the LL2 API does not provide a date for the :class:`Event`, the `date` attribute is set to `datetime(datetime.MINYEAR, 1, 1)`.
21 | This is so the :class:`Event` is sorted to the back of the returned tuple.
22 | """
23 |
24 | def __init__(
25 | self,
26 | name: Optional[str],
27 | location: Optional[str],
28 | date: datetime,
29 | description: Optional[str],
30 | type_: Optional[str],
31 | ):
32 | self.name = name
33 | self.location = location
34 | self.date = date
35 | self.description = description
36 | self.type_ = type_
37 |
38 | def __eq__(self, other: object) -> bool:
39 | if type(self) is type(other):
40 | return self.__dict__ == other.__dict__
41 | return False
42 |
43 | def __repr__(self):
44 | return f"{self.__class__.__module__}.{self.__class__.__qualname__}({', '.join(repr(attr) for attr in self.__dict__.values())})"
45 |
46 |
47 | class Launcher:
48 | """Holds launcher information for instances of the :class:`Launch` class
49 |
50 | This constructor is meant for private use. This class is documented solely for its attributes.
51 |
52 | .. note::
53 |
54 | When the LL2 API does not provide a maiden flight date for the :class:`Launcher`,
55 | the `maiden_flight_date` attribute is set to `datetime(datetime.MINYEAR, 1, 1)`.
56 | """
57 |
58 | def __init__(
59 | self,
60 | name: Optional[str],
61 | payload_leo: Optional[float],
62 | payload_gto: Optional[float],
63 | liftoff_thrust: Optional[float],
64 | liftoff_mass: Optional[float],
65 | max_stages: Optional[int],
66 | height: Optional[float],
67 | successful_launches: Optional[int],
68 | consecutive_successful_launches: Optional[int],
69 | failed_launches: Optional[int],
70 | maiden_flight_date: datetime,
71 | ):
72 |
73 | self.name = name
74 | self.payload_leo = payload_leo
75 | self.payload_gto = payload_gto
76 | self.liftoff_thrust = liftoff_thrust
77 | self.liftoff_mass = liftoff_mass
78 | self.max_stages = max_stages
79 | self.height = height
80 | self.successful_launches = successful_launches
81 | self.consecutive_successful_launches = consecutive_successful_launches
82 | self.failed_launches = failed_launches
83 | self.maiden_flight_date = maiden_flight_date
84 |
85 | def __eq__(self, other: object) -> bool:
86 | if type(self) is type(other):
87 | return self.__dict__ == other.__dict__
88 | return False
89 |
90 | def __repr__(self):
91 | return f"{self.__class__.__module__}.{self.__class__.__qualname__}({', '.join(repr(attr) for attr in self.__dict__.values())})"
92 |
93 |
94 | class Launch(Event):
95 | """Launch event
96 |
97 | This constructor is meant for private use. This class is documented solely for its attributes.
98 |
99 | .. note::
100 |
101 | When the LL2 API does not provide a date for the :class:`Launch`, the `date` attribute is set to `datetime(datetime.MINYEAR, 1, 1)`.
102 | This is so the :class:`Launch` is sorted to the back of the returned tuple.
103 | """
104 |
105 | def __init__(
106 | self,
107 | name: Optional[str],
108 | location: Optional[str],
109 | date: datetime,
110 | description: Optional[str],
111 | type_: Optional[str],
112 | launcher: Optional[Launcher],
113 | ):
114 | super().__init__(name, location, date, description, type_)
115 | self.launcher = launcher
116 |
117 |
118 | def nextinspace(num_items: int, include_launcher: bool = False) -> Tuple[Union[Launch, Event], ...]:
119 | """This gets the next (specified number) of items from the LL2 API.
120 |
121 | :param num_items: Number of items to get from the API
122 | :type num_items: int
123 | :param include_launcher: Whether to include the launcher of the requested :class:`Launches `, defaults to False
124 | :type include_launcher: bool, optional
125 | :return: Upcoming :class:`Launches ` and :class:`Events `. Note that the length of this tuple will be <= `num_items`.
126 | :rtype: Tuple
127 | :raises requests.exceptions.RequestException: If there is a problem connecting to the API. Also does a `raise_for_status()` call \
128 | so HTTPErrors are possible as well.
129 |
130 | .. warning::
131 |
132 | Because the LL2 API does not offer any way of getting *n* upcoming spaceflight items, this function must query the API twice,
133 | once for the next *n* :class:`Events `, and once for the next *n* :class:`Launches `, and merge the queries
134 | into a sorted form. **As such, this function may be slower than anticipated.** 🙁
135 |
136 | .. deprecated:: 3.0.1
137 |
138 | Because the filter by time function of the LL2 API is currently broken, **upcoming means beyond and including today**.
139 | """
140 | events = next_event(num_items)
141 | launches = next_launch(num_items, include_launcher)
142 | return tuple(merge_sorted_sequences(events, launches, num_items))
143 |
144 |
145 | @typing.no_type_check
146 | def merge_sorted_sequences(
147 | seq_1: Sequence[Union[Launch, Event]], seq_2: Sequence[Union[Launch, Event]], target_length_merged_list: int
148 | ) -> List[Union[Launch, Event]]:
149 | """Perform a merge of two sorted sequences. Sequences must be of Events or of Event subclasses with date attributes"""
150 | l_seq_1 = len(seq_1)
151 | l_seq_2 = len(seq_2)
152 |
153 | # The lengths of two lists added is the max possible length of any combination
154 | max_possible_length = l_seq_1 + l_seq_2
155 |
156 | # The actual length should IDEALLY be as close to the target length as possible, so:
157 | #
158 | # If target length <= max possible length --> we can just set merged length to target length
159 | #
160 | # If target length > max possible length --> the actual length is set to the max possible length
161 | # (which is as close to the target as is possible)
162 | merged_list_length = min(target_length_merged_list, max_possible_length)
163 |
164 | merged_list: Any = [None] * merged_list_length
165 | i = 0
166 | j = 0
167 | k = 0
168 |
169 | # Traverse both lists simultaneously
170 | while i < l_seq_1 and j < l_seq_2:
171 |
172 | # Check if current element of first array is smaller than current element of second array.
173 | # If yes, store first array element and increment first array index. Otherwise do same with second array
174 | if seq_1[i].date < seq_2[j].date:
175 | merged_list[k] = seq_1[i]
176 | k += 1
177 | if k == merged_list_length:
178 | return merged_list
179 | i += 1
180 | else:
181 | merged_list[k] = seq_2[j]
182 | k += 1
183 | if k == merged_list_length:
184 | return merged_list
185 | j += 1
186 |
187 | # Store remaining elements of first list
188 | while i < l_seq_1:
189 | merged_list[k] = seq_1[i]
190 | k += 1
191 | if k == merged_list_length:
192 | return merged_list
193 | i += 1
194 |
195 | # Store remaining elements of second list
196 | while j < l_seq_2:
197 | merged_list[k] = seq_2[j]
198 | k += 1
199 | if k == merged_list_length:
200 | return merged_list
201 | j += 1
202 |
203 | return merged_list
204 |
205 |
206 | def next_launch(num_launches: int, include_launcher: bool = False) -> Tuple[Launch, ...]:
207 | """Same as :func:`nextinspace` but only :class:`Launches ` requested.
208 |
209 | :param num_launches: Number of :class:`Launches ` to get from the API
210 | :type num_launches: int
211 | :param include_launcher: Whether to include the launcher of the requested :class:`Launches `, defaults to False
212 | :type include_launcher: bool, optional
213 | :return: Upcoming :class:`Launches `. Note that the length of this tuple will be <= `num_launches`.
214 | :rtype: Tuple
215 | :raises requests.exceptions.RequestException: If there is a problem connecting to the API. Also does a `raise_for_status()` call \
216 | so HTTPErrors are possible as well.
217 | """
218 | now_str = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ")
219 | data = api_get_request(f"{BASE_URL}/launch", {"limit": num_launches, "net__gte": now_str})
220 |
221 | launches = []
222 | for result in data["results"]:
223 | name = result["name"]
224 |
225 | pad_name = get_nested_dict_val(result, "pad", "name")
226 | pad_location = get_nested_dict_val(result, "pad", "location", "name")
227 | location = build_location_string(pad_name, pad_location)
228 |
229 | date = date_str_to_datetime(result["net"], "%Y-%m-%dT%H:%M:%SZ")
230 | description = get_nested_dict_val(result, "mission", "description")
231 | type_ = get_nested_dict_val(result, "mission", "type")
232 |
233 | launcher_url = get_nested_dict_val(result, "rocket", "configuration", "url")
234 | launcher = get_launcher(launcher_url) if include_launcher else None
235 |
236 | launches.append(Launch(name, location, date, description, type_, launcher))
237 |
238 | return tuple(launches)
239 |
240 |
241 | def build_location_string(pad_name: Optional[str], pad_location: Optional[str]) -> Optional[str]:
242 | if pad_name is not None:
243 | if pad_location is not None:
244 | return f"{pad_name}, {pad_location}"
245 | return pad_name
246 | elif pad_location is not None:
247 | return pad_location
248 | else:
249 | return None
250 |
251 |
252 | def next_event(num_events: int) -> Tuple[Event, ...]:
253 | """Same as :func:`nextinspace` but only :class:`Events ` requested.
254 |
255 | :param num_events: Number of :class:`Events ` to get from the API
256 | :type num_events: int
257 | :return: Upcoming :class:`Events `. Note that the length of this tuple will be <= `num_events`.
258 | :rtype: Tuple
259 | :raises requests.exceptions.RequestException: If there is a problem connecting to the API. Also does a `raise_for_status()` call \
260 | so HTTP errors are possible as well.
261 | """
262 | data = api_get_request(f"{BASE_URL}/event/upcoming", {"limit": num_events})
263 |
264 | events = []
265 | for result in data["results"]:
266 | name = result["name"]
267 | location = result["location"]
268 | date = date_str_to_datetime(result["date"], "%Y-%m-%dT%H:%M:%SZ")
269 | description = result["description"]
270 | type_ = get_nested_dict_val(result, "type", "name")
271 |
272 | events.append(Event(name, location, date, description, type_))
273 |
274 | return tuple(events)
275 |
276 |
277 | def get_nested_dict_val(dict_: Dict, *keys: str) -> Any:
278 | """Get the value present in the nested dict at the specified keys. If a TypeError is raised
279 | (because at some point in the path we find None), then return None. This is necessary because there is
280 | no API documentation I could find that specified when and how values could be left nonexistent.
281 | Note that this method is only required when accessing a nested dict (ex: dict[x][y]).
282 |
283 | :param dictionary: The dictionary to search in
284 | :type dictionary: Dict
285 | :return: Whatever value is at the last nested key
286 | :rtype: Any
287 | """
288 | try:
289 | for key in keys:
290 | dict_ = dict_[key]
291 | return dict_
292 | except TypeError:
293 | return None
294 |
295 |
296 | def get_launcher(url: str) -> Launcher:
297 | """Get launcher from API
298 |
299 | :param url: LL2 API URL for requested :class:`Launcher`
300 | :type url: str
301 | :return: Requested :class:`Launcher`
302 | :rtype: Launcher
303 | """
304 | data = api_get_request(url)
305 |
306 | name = data["full_name"]
307 | payload_leo = data["leo_capacity"]
308 | payload_gto = data["gto_capacity"]
309 | liftoff_thrust = data["to_thrust"]
310 | liftoff_mass = data["launch_mass"]
311 | max_stages = data["max_stage"]
312 | height = data["length"]
313 | successful_launches = data["successful_launches"]
314 | consecutive_successful_launches = data["consecutive_successful_launches"]
315 | failed_launches = data["failed_launches"]
316 | maiden_flight_date = date_str_to_datetime(data["maiden_flight"], "%Y-%m-%d")
317 |
318 | return Launcher(
319 | name,
320 | payload_leo,
321 | payload_gto,
322 | liftoff_thrust,
323 | liftoff_mass,
324 | max_stages,
325 | height,
326 | successful_launches,
327 | consecutive_successful_launches,
328 | failed_launches,
329 | maiden_flight_date,
330 | )
331 |
332 |
333 | def date_str_to_datetime(datetime_str: Optional[str], fmat_str: str) -> datetime:
334 | """Convert datetime string in UTC to datetime object in local timezone
335 |
336 | :param datetime_str:
337 | :type datetime_str: Optional[str]
338 | :param fmat_str: Format str for `datetime.strptime()`
339 | :type fmat_str: str
340 | :return: datetime object in local timezone
341 | :rtype: datetime
342 | """
343 | if datetime_str is None:
344 | return datetime(MINYEAR, 1, 1)
345 | datetime_utc = datetime.strptime(datetime_str, fmat_str).replace(tzinfo=timezone.utc)
346 | return datetime_utc.astimezone()
347 |
348 |
349 | def api_get_request(endpoint: str, payload: Dict = {}) -> Any:
350 | """Make get request to LL2 API
351 |
352 | :param endpoint: API endpoint address
353 | :type endpoint: str
354 | :param payload: Query string for API as defined by Requests, defaults to {}
355 | :type payload: Dict, optional
356 | :return: Either JSON data from the API or raise an exception if the API is unreachable
357 | :rtype: Any
358 | :raises requests.exceptions.RequestException:
359 | """
360 | response = requests.get(endpoint, params=payload)
361 | response.raise_for_status()
362 | return response.json()
363 |
--------------------------------------------------------------------------------
/nextinspace/__main__.py:
--------------------------------------------------------------------------------
1 | from nextinspace.cli import console
2 |
3 | console.run() # type: ignore[no-untyped-call]
4 |
--------------------------------------------------------------------------------
/nextinspace/cli/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gideonshaked/nextinspace/c4100bb6b30f671a88f479ed3474045198d112cf/nextinspace/cli/__init__.py
--------------------------------------------------------------------------------
/nextinspace/cli/console.py:
--------------------------------------------------------------------------------
1 | """Central logic and driver code for CLI"""
2 |
3 | import sys
4 |
5 | import requests
6 |
7 | import nextinspace
8 | from nextinspace.cli import parser, viewer
9 |
10 |
11 | def run():
12 | args = parser.get_args()
13 |
14 | if args.verbose:
15 | verbosity = viewer.Verbosity.verbose
16 | elif args.quiet:
17 | verbosity = viewer.Verbosity.quiet
18 | else:
19 | verbosity = viewer.Verbosity.normal
20 |
21 | include_launcher = verbosity == viewer.Verbosity.verbose
22 |
23 | try:
24 | if args.events_only:
25 | items = nextinspace.next_event(args.num_items)
26 | elif args.launches_only:
27 | items = nextinspace.next_launch(args.num_items, include_launcher)
28 | else:
29 | items = nextinspace.nextinspace(args.num_items, include_launcher)
30 | except requests.exceptions.RequestException as err:
31 | sys.exit(f"nextinspace: {err}")
32 |
33 | if args.json:
34 | viewer.show_json(items)
35 | else:
36 | viewer.display(items, verbosity)
37 |
--------------------------------------------------------------------------------
/nextinspace/cli/parser.py:
--------------------------------------------------------------------------------
1 | """Parse arguments from the CLI"""
2 |
3 | import argparse
4 |
5 |
6 | def get_args():
7 | parser = argparse.ArgumentParser(prog="nextinspace", description="Never miss a launch.")
8 |
9 | # Number of events wanted by user
10 | parser.add_argument(
11 | "num_items",
12 | default=1,
13 | metavar="number of items",
14 | nargs="?",
15 | type=positive_int,
16 | help="The number of items to display.",
17 | )
18 |
19 | # Group of events only and launches only flags.
20 | # Obviously, only one can be passed.
21 | filtering_options = parser.add_mutually_exclusive_group()
22 | filtering_options.add_argument(
23 | "-e",
24 | "--events-only",
25 | action="store_true",
26 | help="Only show events. These are typically not covered by standard launches. These events could be spacecraft landings, engine tests, or spacewalks.",
27 | )
28 | filtering_options.add_argument(
29 | "-l",
30 | "--launches-only",
31 | action="store_true",
32 | help="Only display orbital and suborbital launches. Generally these will be all orbital launches and suborbital launches which aim to reach “space” or the Karman line.",
33 | )
34 |
35 | # Verbosity arguments group
36 | verbosity_options = parser.add_mutually_exclusive_group()
37 | verbosity_options.add_argument(
38 | "-v", "--verbose", action="store_true", help="Display additional details about launches."
39 | )
40 | verbosity_options.add_argument(
41 | "-q", "--quiet", action="store_true", help="Only display name, location, date, and type."
42 | )
43 |
44 | # JSON output
45 | parser.add_argument(
46 | "--json",
47 | action="store_true",
48 | help="Output data in JSON format. Note that '--quiet' has no effect when this flag is set.",
49 | )
50 |
51 | # Version argument
52 | parser.add_argument("--version", action="version", version="%(prog)s v" + __import__("nextinspace").__version__)
53 |
54 | return parser.parse_args()
55 |
56 |
57 | def positive_int(x):
58 | i = int(x)
59 | if i <= 0:
60 | raise ValueError()
61 | return i
62 |
--------------------------------------------------------------------------------
/nextinspace/cli/viewer.py:
--------------------------------------------------------------------------------
1 | """Viewer for terminal output
2 |
3 | This code is (excluding the json output) isinherited from v1 and needs to be
4 | refactored. Properly methodizing this code would be putting lipstick on a pig,
5 | so to refactor properly would be to use a library like Rich. Eventually...
6 | """
7 |
8 | import json
9 | import textwrap as t
10 | from datetime import MINYEAR, datetime, timezone
11 | from enum import Enum
12 |
13 | from colorama import Fore, Style, deinit, init
14 |
15 | import nextinspace
16 |
17 | MAX_LINE_LENGTH = 88
18 | CHART_WIDTH = 59
19 | DATE_FMAT_STR = "%a %B %d, %Y %I:%M %p %Z"
20 |
21 |
22 | class Verbosity(Enum):
23 | quiet = 1
24 | normal = 2
25 | verbose = 3
26 |
27 |
28 | # ---- Top-level display functions ----
29 |
30 |
31 | def display(items, verbosity):
32 | if len(items) == 0:
33 | return
34 |
35 | show_top()
36 |
37 | init() # For compatibility with Windows terminals
38 | display_item(items[0], verbosity)
39 | for item in items[1:]:
40 | show_divider()
41 | display_item(item, verbosity)
42 | deinit() # For compatibility with Windows terminals
43 |
44 | show_bottom()
45 |
46 |
47 | def display_item(item, verbosity):
48 | if type(item) is nextinspace.Event:
49 | display_event(item, verbosity)
50 | else:
51 | display_launch(item, verbosity)
52 |
53 |
54 | def show_top():
55 | print("┌" + "─" * MAX_LINE_LENGTH + "┐")
56 |
57 |
58 | def show_divider():
59 | print("├" + "─" * MAX_LINE_LENGTH + "┤")
60 |
61 |
62 | def show_bottom():
63 | print("└" + "─" * MAX_LINE_LENGTH + "┘")
64 |
65 |
66 | # ---- Launch and Event display functions ----
67 |
68 |
69 | def display_event(event, verbosity):
70 | show_name(event.name)
71 | show_location(event.location)
72 | show_filler()
73 | show_date(event.date)
74 | show_type(event, event.type_)
75 |
76 | # If verbosity is not set to quiet, show description
77 | if verbosity != Verbosity.quiet:
78 | show_filler()
79 | show_description(event.description)
80 |
81 |
82 | def display_launch(launch, verbosity):
83 | show_name(launch.name)
84 | show_location(launch.location)
85 | show_filler()
86 | show_date(launch.date)
87 | show_type(launch, launch.type_)
88 |
89 | # If verbosity is not set to quiet, print mission description
90 | if verbosity != Verbosity.quiet:
91 | # If verbosity is set to verbose, print rocket information
92 | if verbosity == Verbosity.verbose:
93 | show_filler()
94 | display_launcher(launch.launcher)
95 |
96 | show_filler()
97 | show_description(launch.description)
98 |
99 |
100 | # ---- Launch and Event display helper functions ----
101 |
102 |
103 | def show_name(name):
104 | if name is not None:
105 | mission_name_lines = t.wrap(name, width=MAX_LINE_LENGTH)
106 | for line in mission_name_lines:
107 | print("│" + Style.BRIGHT + Fore.CYAN + line.ljust(MAX_LINE_LENGTH, " ") + Style.RESET_ALL + "│")
108 | else:
109 | print("│" + Style.BRIGHT + Fore.CYAN + "Name Unavailable".ljust(MAX_LINE_LENGTH, " ") + Style.RESET_ALL + "│")
110 |
111 |
112 | def show_location(location):
113 | if location is not None:
114 | location_lines = t.wrap(location, width=MAX_LINE_LENGTH)
115 | for line in location_lines:
116 | print("│" + Fore.CYAN + line.ljust(MAX_LINE_LENGTH, " ") + Fore.RESET + "│")
117 | else:
118 | print("│" + Fore.CYAN + "Location Unavailable".ljust(MAX_LINE_LENGTH, " ") + Fore.RESET + "│")
119 |
120 |
121 | def show_date(date):
122 | if date != datetime(MINYEAR, 1, 1):
123 | print("│" + Fore.GREEN + (" " + date.strftime(DATE_FMAT_STR)).ljust(MAX_LINE_LENGTH, " ") + Fore.RESET + "│")
124 | else:
125 | print("│" + Fore.GREEN + " Date Unavailable".ljust(MAX_LINE_LENGTH, " ") + Fore.RESET + "│")
126 |
127 |
128 | def show_type(obj, type_):
129 | if type_ is not None:
130 | print("│" + (" " + obj.__class__.__qualname__ + " Type: " + type_).ljust(MAX_LINE_LENGTH, " ") + "│")
131 | else:
132 | print("│" + (" " + obj.__class__.__qualname__ + " Type Unavailable").ljust(MAX_LINE_LENGTH, " ") + "│")
133 |
134 |
135 | def show_description(description):
136 | if description is not None:
137 | mission_description_lines = t.wrap(
138 | description, width=MAX_LINE_LENGTH, initial_indent=" ", subsequent_indent=" "
139 | )
140 | for line in mission_description_lines:
141 | print("│" + line.ljust(MAX_LINE_LENGTH, " ") + "│")
142 | else:
143 | print("│" + (" Mission Description Unavailable").ljust(MAX_LINE_LENGTH, " ") + "│")
144 |
145 |
146 | def show_filler():
147 | print("│" + " " * MAX_LINE_LENGTH + "│")
148 |
149 |
150 | # ---- Launcher display functions ----
151 |
152 |
153 | def display_launcher(launcher):
154 | print("│" + ("┌" + "─" * CHART_WIDTH + "┐").center(MAX_LINE_LENGTH, " ") + "│")
155 | if launcher.name is not None:
156 | print("│" + ("│" + launcher.name.center(CHART_WIDTH) + "│").center(MAX_LINE_LENGTH, " ") + "│")
157 | else:
158 | print("│" + ("│" + "Name Unavailable".center(CHART_WIDTH) + "│").center(MAX_LINE_LENGTH, " ") + "│")
159 |
160 | show_chart_divider()
161 | show_chart_line(
162 | get_side("Height: ", launcher.height, " m"),
163 | get_side("Mass to LEO: ", launcher.payload_leo, " kg"),
164 | )
165 | show_chart_divider()
166 |
167 | show_chart_line(
168 | get_side("Max Stages: ", launcher.max_stages),
169 | get_side("Liftoff Thrust: ", launcher.liftoff_thrust, " kN"),
170 | )
171 | show_chart_divider()
172 |
173 | show_chart_line(
174 | get_side("Mass to GTO: ", launcher.payload_gto, " kg"),
175 | get_side("Liftoff Mass: ", launcher.liftoff_mass, " Tonnes"),
176 | )
177 | show_chart_divider()
178 |
179 | if launcher.maiden_flight_date != datetime(MINYEAR, 1, 1):
180 | date_str = launcher.maiden_flight_date.strftime("%Y-%m-%d")
181 | else:
182 | date_str = "Unavailable"
183 | show_chart_line(
184 | get_side("Launch Successes: ", launcher.successful_launches),
185 | "Maiden Flight: " + date_str,
186 | )
187 | show_chart_divider()
188 |
189 | show_chart_line(
190 | get_side("Consecutive Successes: ", launcher.consecutive_successful_launches),
191 | get_side("Failed Launches: ", launcher.failed_launches),
192 | )
193 |
194 | print("│" + ("└" + "─" * CHART_WIDTH + "┘").center(MAX_LINE_LENGTH, " ") + "│")
195 |
196 |
197 | def show_chart_line(left, right):
198 | row = left.center(CHART_WIDTH // 2, " ") + "│" + right.center(CHART_WIDTH // 2, " ")
199 | print("│" + ("│" + row.center(CHART_WIDTH, " ") + "│").center(MAX_LINE_LENGTH, " ") + "│")
200 |
201 |
202 | def get_side(pre, value, post=""):
203 | """Get one side of the chart if the value is not None"""
204 |
205 | if value is not None:
206 | return pre + str(value) + post
207 | return pre + "Unavailable"
208 |
209 |
210 | def show_chart_divider():
211 | print("│" + ("├" + "─" * CHART_WIDTH + "┤").center(MAX_LINE_LENGTH, " ") + "│")
212 |
213 |
214 | # ---- JSON output ----
215 |
216 |
217 | def show_json(items_list):
218 | output_list = [dict_item(item) for item in items_list]
219 | print(json.dumps(output_list, indent=4))
220 |
221 |
222 | def dict_item(item):
223 | if type(item) is nextinspace.Event:
224 | return dict_event(item)
225 | return dict_launch(item)
226 |
227 |
228 | def dict_launch(launch):
229 | return {
230 | "type": "launch",
231 | "name": launch.name,
232 | "location": launch.location,
233 | "date": launch.date.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
234 | "description": launch.description,
235 | "subtype": launch.type_,
236 | "launcher": dict_launcher(launch.launcher),
237 | }
238 |
239 |
240 | def dict_launcher(launcher):
241 | if launcher is not None:
242 | return {
243 | "name": launcher.name,
244 | "payload_leo": launcher.payload_leo,
245 | "payload_gto": launcher.payload_gto,
246 | "liftoff_thrust": launcher.liftoff_thrust,
247 | "liftoff_mass": launcher.liftoff_mass,
248 | "max_stages": launcher.max_stages,
249 | "height": launcher.height,
250 | "successful_launches": launcher.successful_launches,
251 | "consecutive_successful_launches": launcher.consecutive_successful_launches,
252 | "failed_launches": launcher.failed_launches,
253 | "maiden_flight_date": launcher.maiden_flight_date.astimezone(timezone.utc).strftime("%Y-%m-%d"),
254 | }
255 | return None
256 |
257 |
258 | def dict_event(event):
259 | return {
260 | "type": "event",
261 | "name": event.name,
262 | "location": event.location,
263 | "date": event.date.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
264 | "description": event.description,
265 | "subtype": event.type_,
266 | }
267 |
--------------------------------------------------------------------------------
/poetry.lock:
--------------------------------------------------------------------------------
1 | # This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand.
2 |
3 | [metadata]
4 | lock-version = "2.0"
5 | python-versions = "^3.10"
6 | content-hash = "5bc16754714157f1175ccc8c5daf7d1838faca6a2d954f1bc8b47966d7a32ded"
7 |
8 | [[package]]
9 | name = "bump2version"
10 | version = "1.0.1"
11 | description = "Version-bump your software with a single command!"
12 | optional = false
13 | python-versions = ">=3.5"
14 | files = [
15 | {file = "bump2version-1.0.1-py2.py3-none-any.whl", hash = "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410"},
16 | {file = "bump2version-1.0.1.tar.gz", hash = "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6"}
17 | ]
18 |
19 | [[package]]
20 | name = "certifi"
21 | version = "2024.12.14"
22 | description = "Python package for providing Mozilla's CA Bundle."
23 | optional = false
24 | python-versions = ">=3.6"
25 | files = [
26 | {file = "certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56"},
27 | {file = "certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"}
28 | ]
29 |
30 | [[package]]
31 | name = "cfgv"
32 | version = "3.4.0"
33 | description = "Validate configuration and produce human readable error messages."
34 | optional = false
35 | python-versions = ">=3.8"
36 | files = [
37 | {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"},
38 | {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}
39 | ]
40 |
41 | [[package]]
42 | name = "charset-normalizer"
43 | version = "3.4.0"
44 | description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
45 | optional = false
46 | python-versions = ">=3.7.0"
47 | files = [
48 | {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"},
49 | {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"},
50 | {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"},
51 | {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"},
52 | {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"},
53 | {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"},
54 | {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"},
55 | {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"},
56 | {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"},
57 | {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"},
58 | {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"},
59 | {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"},
60 | {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"},
61 | {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"},
62 | {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"},
63 | {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"},
64 | {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"},
65 | {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"},
66 | {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"},
67 | {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"},
68 | {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"},
69 | {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"},
70 | {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"},
71 | {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"},
72 | {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"},
73 | {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"},
74 | {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"},
75 | {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"},
76 | {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"},
77 | {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"},
78 | {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"},
79 | {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"},
80 | {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"},
81 | {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"},
82 | {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"},
83 | {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"},
84 | {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"},
85 | {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"},
86 | {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"},
87 | {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"},
88 | {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"},
89 | {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"},
90 | {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"},
91 | {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"},
92 | {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"},
93 | {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"},
94 | {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"},
95 | {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"},
96 | {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"},
97 | {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"},
98 | {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"},
99 | {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"},
100 | {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"},
101 | {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"},
102 | {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"},
103 | {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"},
104 | {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"},
105 | {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"},
106 | {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"},
107 | {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"},
108 | {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"},
109 | {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"},
110 | {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"},
111 | {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"},
112 | {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"},
113 | {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"},
114 | {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"},
115 | {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"},
116 | {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"},
117 | {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"},
118 | {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"},
119 | {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"},
120 | {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"},
121 | {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"},
122 | {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"},
123 | {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"},
124 | {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"},
125 | {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"},
126 | {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"},
127 | {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"},
128 | {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"},
129 | {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"},
130 | {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"},
131 | {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"},
132 | {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"},
133 | {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"},
134 | {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"},
135 | {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"},
136 | {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"},
137 | {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"},
138 | {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"},
139 | {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"},
140 | {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"},
141 | {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"},
142 | {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"},
143 | {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"},
144 | {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"},
145 | {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"},
146 | {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"},
147 | {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"},
148 | {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"},
149 | {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"},
150 | {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"},
151 | {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"},
152 | {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"}
153 | ]
154 |
155 | [[package]]
156 | name = "colorama"
157 | version = "0.4.6"
158 | description = "Cross-platform colored terminal text."
159 | optional = false
160 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
161 | files = [
162 | {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
163 | {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}
164 | ]
165 |
166 | [[package]]
167 | name = "coverage"
168 | version = "5.5"
169 | description = "Code coverage measurement for Python"
170 | optional = false
171 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4"
172 | files = [
173 | {file = "coverage-5.5-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf"},
174 | {file = "coverage-5.5-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b"},
175 | {file = "coverage-5.5-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669"},
176 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90"},
177 | {file = "coverage-5.5-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c"},
178 | {file = "coverage-5.5-cp27-cp27m-win32.whl", hash = "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a"},
179 | {file = "coverage-5.5-cp27-cp27m-win_amd64.whl", hash = "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82"},
180 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905"},
181 | {file = "coverage-5.5-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083"},
182 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5"},
183 | {file = "coverage-5.5-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81"},
184 | {file = "coverage-5.5-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6"},
185 | {file = "coverage-5.5-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0"},
186 | {file = "coverage-5.5-cp310-cp310-win_amd64.whl", hash = "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae"},
187 | {file = "coverage-5.5-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb"},
188 | {file = "coverage-5.5-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160"},
189 | {file = "coverage-5.5-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6"},
190 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701"},
191 | {file = "coverage-5.5-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793"},
192 | {file = "coverage-5.5-cp35-cp35m-win32.whl", hash = "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e"},
193 | {file = "coverage-5.5-cp35-cp35m-win_amd64.whl", hash = "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3"},
194 | {file = "coverage-5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066"},
195 | {file = "coverage-5.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a"},
196 | {file = "coverage-5.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465"},
197 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb"},
198 | {file = "coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821"},
199 | {file = "coverage-5.5-cp36-cp36m-win32.whl", hash = "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45"},
200 | {file = "coverage-5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184"},
201 | {file = "coverage-5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a"},
202 | {file = "coverage-5.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53"},
203 | {file = "coverage-5.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d"},
204 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638"},
205 | {file = "coverage-5.5-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3"},
206 | {file = "coverage-5.5-cp37-cp37m-win32.whl", hash = "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a"},
207 | {file = "coverage-5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a"},
208 | {file = "coverage-5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6"},
209 | {file = "coverage-5.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2"},
210 | {file = "coverage-5.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759"},
211 | {file = "coverage-5.5-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873"},
212 | {file = "coverage-5.5-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a"},
213 | {file = "coverage-5.5-cp38-cp38-win32.whl", hash = "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6"},
214 | {file = "coverage-5.5-cp38-cp38-win_amd64.whl", hash = "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502"},
215 | {file = "coverage-5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b"},
216 | {file = "coverage-5.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529"},
217 | {file = "coverage-5.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b"},
218 | {file = "coverage-5.5-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff"},
219 | {file = "coverage-5.5-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b"},
220 | {file = "coverage-5.5-cp39-cp39-win32.whl", hash = "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6"},
221 | {file = "coverage-5.5-cp39-cp39-win_amd64.whl", hash = "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03"},
222 | {file = "coverage-5.5-pp36-none-any.whl", hash = "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079"},
223 | {file = "coverage-5.5-pp37-none-any.whl", hash = "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4"},
224 | {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}
225 | ]
226 |
227 | [package.dependencies]
228 | toml = {version = "*", optional = true, markers = "extra == \"toml\""}
229 |
230 | [package.extras]
231 | toml = ["toml"]
232 |
233 | [[package]]
234 | name = "distlib"
235 | version = "0.3.9"
236 | description = "Distribution utilities"
237 | optional = false
238 | python-versions = "*"
239 | files = [
240 | {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"},
241 | {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}
242 | ]
243 |
244 | [[package]]
245 | name = "exceptiongroup"
246 | version = "1.2.2"
247 | description = "Backport of PEP 654 (exception groups)"
248 | optional = false
249 | python-versions = ">=3.7"
250 | files = [
251 | {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"},
252 | {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}
253 | ]
254 |
255 | [package.extras]
256 | test = ["pytest (>=6)"]
257 |
258 | [[package]]
259 | name = "filelock"
260 | version = "3.16.1"
261 | description = "A platform independent file lock."
262 | optional = false
263 | python-versions = ">=3.8"
264 | files = [
265 | {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"},
266 | {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}
267 | ]
268 |
269 | [package.extras]
270 | docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4.1)"]
271 | testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"]
272 | typing = ["typing-extensions (>=4.12.2)"]
273 |
274 | [[package]]
275 | name = "identify"
276 | version = "2.6.3"
277 | description = "File identification library for Python"
278 | optional = false
279 | python-versions = ">=3.9"
280 | files = [
281 | {file = "identify-2.6.3-py2.py3-none-any.whl", hash = "sha256:9edba65473324c2ea9684b1f944fe3191db3345e50b6d04571d10ed164f8d7bd"},
282 | {file = "identify-2.6.3.tar.gz", hash = "sha256:62f5dae9b5fef52c84cc188514e9ea4f3f636b1d8799ab5ebc475471f9e47a02"}
283 | ]
284 |
285 | [package.extras]
286 | license = ["ukkonen"]
287 |
288 | [[package]]
289 | name = "idna"
290 | version = "3.10"
291 | description = "Internationalized Domain Names in Applications (IDNA)"
292 | optional = false
293 | python-versions = ">=3.6"
294 | files = [
295 | {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"},
296 | {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}
297 | ]
298 |
299 | [package.extras]
300 | all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
301 |
302 | [[package]]
303 | name = "iniconfig"
304 | version = "2.0.0"
305 | description = "brain-dead simple config-ini parsing"
306 | optional = false
307 | python-versions = ">=3.7"
308 | files = [
309 | {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
310 | {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}
311 | ]
312 |
313 | [[package]]
314 | name = "nodeenv"
315 | version = "1.9.1"
316 | description = "Node.js virtual environment builder"
317 | optional = false
318 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
319 | files = [
320 | {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"},
321 | {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}
322 | ]
323 |
324 | [[package]]
325 | name = "packaging"
326 | version = "24.2"
327 | description = "Core utilities for Python packages"
328 | optional = false
329 | python-versions = ">=3.8"
330 | files = [
331 | {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"},
332 | {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}
333 | ]
334 |
335 | [[package]]
336 | name = "platformdirs"
337 | version = "4.3.6"
338 | description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`."
339 | optional = false
340 | python-versions = ">=3.8"
341 | files = [
342 | {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"},
343 | {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}
344 | ]
345 |
346 | [package.extras]
347 | docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"]
348 | test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"]
349 | type = ["mypy (>=1.11.2)"]
350 |
351 | [[package]]
352 | name = "pluggy"
353 | version = "1.5.0"
354 | description = "plugin and hook calling mechanisms for python"
355 | optional = false
356 | python-versions = ">=3.8"
357 | files = [
358 | {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
359 | {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}
360 | ]
361 |
362 | [package.extras]
363 | dev = ["pre-commit", "tox"]
364 | testing = ["pytest", "pytest-benchmark"]
365 |
366 | [[package]]
367 | name = "pre-commit"
368 | version = "2.21.0"
369 | description = "A framework for managing and maintaining multi-language pre-commit hooks."
370 | optional = false
371 | python-versions = ">=3.7"
372 | files = [
373 | {file = "pre_commit-2.21.0-py2.py3-none-any.whl", hash = "sha256:e2f91727039fc39a92f58a588a25b87f936de6567eed4f0e673e0507edc75bad"},
374 | {file = "pre_commit-2.21.0.tar.gz", hash = "sha256:31ef31af7e474a8d8995027fefdfcf509b5c913ff31f2015b4ec4beb26a6f658"}
375 | ]
376 |
377 | [package.dependencies]
378 | cfgv = ">=2.0.0"
379 | identify = ">=1.0.0"
380 | nodeenv = ">=0.11.1"
381 | pyyaml = ">=5.1"
382 | virtualenv = ">=20.10.0"
383 |
384 | [[package]]
385 | name = "pytest"
386 | version = "7.4.4"
387 | description = "pytest: simple powerful testing with Python"
388 | optional = false
389 | python-versions = ">=3.7"
390 | files = [
391 | {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},
392 | {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}
393 | ]
394 |
395 | [package.dependencies]
396 | colorama = {version = "*", markers = "sys_platform == \"win32\""}
397 | exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
398 | iniconfig = "*"
399 | packaging = "*"
400 | pluggy = ">=0.12,<2.0"
401 | tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
402 |
403 | [package.extras]
404 | testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
405 |
406 | [[package]]
407 | name = "pytest-lazy-fixtures"
408 | version = "1.1.1"
409 | description = "Allows you to use fixtures in @pytest.mark.parametrize."
410 | optional = false
411 | python-versions = "<4.0,>=3.8"
412 | files = [
413 | {file = "pytest_lazy_fixtures-1.1.1-py3-none-any.whl", hash = "sha256:a4b396a361faf56c6305535fd0175ce82902ca7cf668c4d812a25ed2bcde8183"},
414 | {file = "pytest_lazy_fixtures-1.1.1.tar.gz", hash = "sha256:0c561f0d29eea5b55cf29b9264a3241999ffdb74c6b6e8c4ccc0bd2c934d01ed"}
415 | ]
416 |
417 | [package.dependencies]
418 | pytest = ">=7"
419 |
420 | [[package]]
421 | name = "pyyaml"
422 | version = "6.0.2"
423 | description = "YAML parser and emitter for Python"
424 | optional = false
425 | python-versions = ">=3.8"
426 | files = [
427 | {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"},
428 | {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"},
429 | {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"},
430 | {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"},
431 | {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"},
432 | {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"},
433 | {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"},
434 | {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"},
435 | {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"},
436 | {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"},
437 | {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"},
438 | {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"},
439 | {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"},
440 | {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"},
441 | {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"},
442 | {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"},
443 | {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"},
444 | {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"},
445 | {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"},
446 | {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"},
447 | {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"},
448 | {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"},
449 | {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"},
450 | {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"},
451 | {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"},
452 | {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"},
453 | {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"},
454 | {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"},
455 | {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"},
456 | {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"},
457 | {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"},
458 | {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"},
459 | {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"},
460 | {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"},
461 | {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"},
462 | {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"},
463 | {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"},
464 | {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"},
465 | {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"},
466 | {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"},
467 | {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"},
468 | {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"},
469 | {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"},
470 | {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"},
471 | {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"},
472 | {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"},
473 | {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"},
474 | {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"},
475 | {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"},
476 | {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"},
477 | {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"},
478 | {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"},
479 | {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}
480 | ]
481 |
482 | [[package]]
483 | name = "requests"
484 | version = "2.32.3"
485 | description = "Python HTTP for Humans."
486 | optional = false
487 | python-versions = ">=3.8"
488 | files = [
489 | {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"},
490 | {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}
491 | ]
492 |
493 | [package.dependencies]
494 | certifi = ">=2017.4.17"
495 | charset-normalizer = ">=2,<4"
496 | idna = ">=2.5,<4"
497 | urllib3 = ">=1.21.1,<3"
498 |
499 | [package.extras]
500 | socks = ["PySocks (>=1.5.6,!=1.5.7)"]
501 | use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
502 |
503 | [[package]]
504 | name = "requests-mock"
505 | version = "1.12.1"
506 | description = "Mock out responses from the requests package"
507 | optional = false
508 | python-versions = ">=3.5"
509 | files = [
510 | {file = "requests-mock-1.12.1.tar.gz", hash = "sha256:e9e12e333b525156e82a3c852f22016b9158220d2f47454de9cae8a77d371401"},
511 | {file = "requests_mock-1.12.1-py2.py3-none-any.whl", hash = "sha256:b1e37054004cdd5e56c84454cc7df12b25f90f382159087f4b6915aaeef39563"}
512 | ]
513 |
514 | [package.dependencies]
515 | requests = ">=2.22,<3"
516 |
517 | [package.extras]
518 | fixture = ["fixtures"]
519 |
520 | [[package]]
521 | name = "toml"
522 | version = "0.10.2"
523 | description = "Python Library for Tom's Obvious, Minimal Language"
524 | optional = false
525 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
526 | files = [
527 | {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},
528 | {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}
529 | ]
530 |
531 | [[package]]
532 | name = "tomli"
533 | version = "2.2.1"
534 | description = "A lil' TOML parser"
535 | optional = false
536 | python-versions = ">=3.8"
537 | files = [
538 | {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"},
539 | {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"},
540 | {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"},
541 | {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"},
542 | {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"},
543 | {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"},
544 | {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"},
545 | {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"},
546 | {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"},
547 | {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"},
548 | {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"},
549 | {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"},
550 | {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"},
551 | {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"},
552 | {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"},
553 | {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"},
554 | {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"},
555 | {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"},
556 | {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"},
557 | {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"},
558 | {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"},
559 | {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"},
560 | {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"},
561 | {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"},
562 | {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"},
563 | {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"},
564 | {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"},
565 | {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"},
566 | {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"},
567 | {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"},
568 | {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"},
569 | {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}
570 | ]
571 |
572 | [[package]]
573 | name = "urllib3"
574 | version = "2.2.3"
575 | description = "HTTP library with thread-safe connection pooling, file post, and more."
576 | optional = false
577 | python-versions = ">=3.8"
578 | files = [
579 | {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"},
580 | {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}
581 | ]
582 |
583 | [package.extras]
584 | brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
585 | h2 = ["h2 (>=4,<5)"]
586 | socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
587 | zstd = ["zstandard (>=0.18.0)"]
588 |
589 | [[package]]
590 | name = "virtualenv"
591 | version = "20.28.0"
592 | description = "Virtual Python Environment builder"
593 | optional = false
594 | python-versions = ">=3.8"
595 | files = [
596 | {file = "virtualenv-20.28.0-py3-none-any.whl", hash = "sha256:23eae1b4516ecd610481eda647f3a7c09aea295055337331bb4e6892ecce47b0"},
597 | {file = "virtualenv-20.28.0.tar.gz", hash = "sha256:2c9c3262bb8e7b87ea801d715fae4495e6032450c71d2309be9550e7364049aa"}
598 | ]
599 |
600 | [package.dependencies]
601 | distlib = ">=0.3.7,<1"
602 | filelock = ">=3.12.2,<4"
603 | platformdirs = ">=3.9.1,<5"
604 |
605 | [package.extras]
606 | docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"]
607 | test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"]
608 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = ["poetry_core>=1.0.0"]
3 | build-backend = "poetry.core.masonry.api"
4 |
5 | [tool.black]
6 | line-length = 120
7 | exclude = '''
8 | /(
9 | \.git
10 | | \.hg
11 | | \.mypy_cache
12 | | \.tox
13 | | \.venv
14 | | _build
15 | | buck-out
16 | | build
17 | | dist
18 | )/
19 | '''
20 |
21 | [tool.coverage.run]
22 | omit = ["*/site-packages/*"]
23 |
24 | [tool.flakehell]
25 | max_line_length = 120
26 | exclude = [".git", "__pycache__"]
27 |
28 | [tool.flakehell.exceptions."tests/"]
29 | pyflakes = ["-F403", "-F405"]
30 |
31 | [tool.flakehell.plugins]
32 | pyflakes = ["+*"]
33 | pycodestyle = ["+*", "-E501", "-W503"]
34 |
35 | [tool.isort]
36 | profile = "black"
37 |
38 | [tool.poetry]
39 | name = "nextinspace"
40 | version = "3.0.1"
41 | description = "Never miss a launch."
42 | license = "GPL-3.0-or-later"
43 | authors = ["Gideon Shaked "]
44 | maintainers = ["Gideon Shaked "]
45 | readme = "README.md"
46 | homepage = "https://github.com/gideonshaked/nextinspace"
47 | repository = "https://github.com/gideonshaked/nextinspace"
48 | keywords = ["space", "nextinspace", "space news", "spaceflight", "rockets"]
49 | classifiers = [
50 | "Environment :: Console",
51 | "License :: OSI Approved :: GNU General Public License (GPL)",
52 | "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
53 | "Programming Language :: Python",
54 | "Programming Language :: Python :: 3.10",
55 | "Programming Language :: Python :: 3.11",
56 | "Programming Language :: Python :: 3.12",
57 | "Programming Language :: Python :: 3.13",
58 | "Programming Language :: Python :: 3 :: Only",
59 | "Natural Language :: English"
60 | ]
61 | include = [
62 | {path = "LICENSE", format = "sdist"}
63 | ]
64 |
65 | [tool.poetry.dependencies]
66 | python = "^3.10"
67 | requests = "^2.24"
68 | colorama = "^0.4.3"
69 |
70 | [tool.poetry.dev-dependencies]
71 | bump2version = "^1.0.1"
72 | pre-commit = "^2.9.3"
73 | pytest = "^7.0.0"
74 | requests-mock = "^1.8"
75 | pytest-lazy-fixtures = "^1.1.1"
76 | coverage = {version = "^5.3.1", extras = ["toml"]}
77 |
78 | [tool.poetry.scripts]
79 | nextinspace = "nextinspace.cli.console:run"
80 |
--------------------------------------------------------------------------------
/tests/cli/test_viewer.py:
--------------------------------------------------------------------------------
1 | # type: ignore
2 |
3 | import pytest
4 | from pytest_lazy_fixtures import lf
5 |
6 | from nextinspace.cli import viewer
7 |
8 |
9 | def test_dict_event(example_event, example_event_dict):
10 | assert viewer.dict_event(example_event) == example_event_dict
11 |
12 |
13 | @pytest.mark.parametrize(
14 | "launcher, dict_",
15 | [
16 | (
17 | lf("example_launcher"),
18 | lf("example_launcher_dict"),
19 | ),
20 | (None, None),
21 | ],
22 | )
23 | def test_dict_launcher(launcher, dict_):
24 | assert viewer.dict_launcher(launcher) == dict_
25 |
26 |
27 | @pytest.mark.parametrize(
28 | "launch, dict_",
29 | [
30 | (
31 | lf("example_launch_verbose"),
32 | lf("example_launch_verbose_dict"),
33 | ),
34 | (
35 | lf("example_launch_normal"),
36 | lf("example_launch_normal_dict"),
37 | ),
38 | ],
39 | )
40 | def test_dict_launch(launch, dict_):
41 | assert viewer.dict_launch(launch) == dict_
42 |
43 |
44 | @pytest.mark.parametrize(
45 | "item, dict_",
46 | [
47 | (
48 | lf("example_launch_normal"),
49 | lf("example_launch_normal_dict"),
50 | ),
51 | (
52 | lf("example_event"),
53 | lf("example_event_dict"),
54 | ),
55 | ],
56 | )
57 | def test_dict_item(item, dict_):
58 | assert viewer.dict_item(item) == dict_
59 |
--------------------------------------------------------------------------------
/tests/conftest.py:
--------------------------------------------------------------------------------
1 | """Pytest fixtures"""
2 |
3 | from datetime import datetime
4 |
5 | import pytest
6 |
7 | import nextinspace
8 |
9 |
10 | @pytest.fixture
11 | def example_launch_text():
12 | return open("tests/data/launch.json", "r").read()
13 |
14 |
15 | @pytest.fixture
16 | def example_launcher_text():
17 | return open("tests/data/launcher.json", "r").read()
18 |
19 |
20 | @pytest.fixture
21 | def example_event_text():
22 | return open("tests/data/event.json", "r").read()
23 |
24 |
25 | @pytest.fixture
26 | def example_launch_verbose(example_launcher):
27 | return nextinspace.Launch(
28 | name="New Shepard | NS-13",
29 | location="West Texas Suborbital Launch Site/ Corn Ranch, Corn Ranch, USA",
30 | description="This will be the 13th New Shepard mission...",
31 | date=nextinspace.date_str_to_datetime("2020-09-24T15:00:00Z", "%Y-%m-%dT%H:%M:%SZ"),
32 | type_="Suborbital",
33 | launcher=example_launcher,
34 | )
35 |
36 |
37 | @pytest.fixture
38 | def example_launch_normal():
39 | return nextinspace.Launch(
40 | name="New Shepard | NS-13",
41 | location="West Texas Suborbital Launch Site/ Corn Ranch, Corn Ranch, USA",
42 | description="This will be the 13th New Shepard mission...",
43 | date=nextinspace.date_str_to_datetime("2020-09-24T15:00:00Z", "%Y-%m-%dT%H:%M:%SZ"),
44 | type_="Suborbital",
45 | launcher=None,
46 | )
47 |
48 |
49 | @pytest.fixture
50 | def example_event():
51 | return nextinspace.Event(
52 | name="2017 NASA Astronaut class graduation ceremony",
53 | location="NASA's Johnson Space Center, Houston, TX, USA",
54 | description="NASA will honor the first class of astronaut...",
55 | date=nextinspace.date_str_to_datetime("2020-01-10T15:30:00Z", "%Y-%m-%dT%H:%M:%SZ"),
56 | type_="Press Event",
57 | )
58 |
59 |
60 | @pytest.fixture
61 | def example_launcher():
62 | return nextinspace.Launcher(
63 | name="New Shepard",
64 | payload_leo=0,
65 | payload_gto=0,
66 | liftoff_thrust=490,
67 | liftoff_mass=75,
68 | max_stages=1,
69 | height=15.0,
70 | successful_launches=12,
71 | consecutive_successful_launches=12,
72 | failed_launches=0,
73 | maiden_flight_date=nextinspace.date_str_to_datetime("2015-04-29", "%Y-%m-%d"),
74 | )
75 |
76 |
77 | class DateHolder:
78 | """Placeholder for Launches or Events with actual date attributes"""
79 |
80 | def __init__(self, size):
81 | self.date = datetime(size, 1, 1)
82 |
83 |
84 | @pytest.fixture
85 | def list_1():
86 | return [DateHolder(size) for size in range(1, 8)]
87 |
88 |
89 | @pytest.fixture
90 | def list_2():
91 | return [DateHolder(size * 2) for size in range(1, 8)]
92 |
93 |
94 | @pytest.fixture
95 | def example_event_dict():
96 | return {
97 | "type": "event",
98 | "name": "2017 NASA Astronaut class graduation ceremony",
99 | "location": "NASA's Johnson Space Center, Houston, TX, USA",
100 | "date": "2020-01-10T15:30:00Z",
101 | "description": "NASA will honor the first class of astronaut...",
102 | "subtype": "Press Event",
103 | }
104 |
105 |
106 | @pytest.fixture
107 | def example_launcher_dict():
108 | return {
109 | "name": "New Shepard",
110 | "payload_leo": 0,
111 | "payload_gto": 0,
112 | "liftoff_thrust": 490,
113 | "liftoff_mass": 75,
114 | "max_stages": 1,
115 | "height": 15.0,
116 | "successful_launches": 12,
117 | "consecutive_successful_launches": 12,
118 | "failed_launches": 0,
119 | "maiden_flight_date": "2015-04-29",
120 | }
121 |
122 |
123 | @pytest.fixture
124 | def example_launch_normal_dict():
125 | return {
126 | "type": "launch",
127 | "name": "New Shepard | NS-13",
128 | "location": "West Texas Suborbital Launch Site/ Corn Ranch, Corn Ranch, USA",
129 | "date": "2020-09-24T15:00:00Z",
130 | "description": "This will be the 13th New Shepard mission...",
131 | "subtype": "Suborbital",
132 | "launcher": None,
133 | }
134 |
135 |
136 | @pytest.fixture
137 | def example_launch_verbose_dict():
138 | return {
139 | "type": "launch",
140 | "name": "New Shepard | NS-13",
141 | "location": "West Texas Suborbital Launch Site/ Corn Ranch, Corn Ranch, USA",
142 | "date": "2020-09-24T15:00:00Z",
143 | "description": "This will be the 13th New Shepard mission...",
144 | "subtype": "Suborbital",
145 | "launcher": {
146 | "name": "New Shepard",
147 | "payload_leo": 0,
148 | "payload_gto": 0,
149 | "liftoff_thrust": 490,
150 | "liftoff_mass": 75,
151 | "max_stages": 1,
152 | "height": 15.0,
153 | "successful_launches": 12,
154 | "consecutive_successful_launches": 12,
155 | "failed_launches": 0,
156 | "maiden_flight_date": "2015-04-29",
157 | },
158 | }
159 |
--------------------------------------------------------------------------------
/tests/data/event.json:
--------------------------------------------------------------------------------
1 | {
2 | "count": 163,
3 | "next": "https://ll.thespacedevs.com/2.0.0/event/?limit=1&offset=1",
4 | "previous": null,
5 | "results": [
6 | {
7 | "id": 77,
8 | "url": "https://ll.thespacedevs.com/2.0.0/event/77/",
9 | "slug": "2017-nasa-astronaut-class-graduation-ceremony",
10 | "name": "2017 NASA Astronaut class graduation ceremony",
11 | "type": {
12 | "id": 20,
13 | "name": "Press Event"
14 | },
15 | "description": "NASA will honor the first class of astronaut...",
16 | "location": "NASA's Johnson Space Center, Houston, TX, USA",
17 | "news_url": "https://www.nasa.gov/press-release/nasa-s-astronaut-candidates-to-graduate-with-eye-on-artemis-missions",
18 | "video_url": "https://www.youtube.com/watch?v=xo58EoT987M",
19 | "feature_image": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/event_images/20172520nasa2520astronaut2520class2520graduation2520ceremony_image_20191228100802.jpg",
20 | "date": "2020-01-10T15:30:00Z",
21 | "launches": [],
22 | "expeditions": [],
23 | "spacestations": [],
24 | "program": []
25 | }
26 | ]
27 | }
--------------------------------------------------------------------------------
/tests/data/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "count": 202,
3 | "next": "https://ll.thespacedevs.com/2.0.0/launch/?limit=1&net__gte=2020-09-23&offset=1",
4 | "previous": null,
5 | "results": [
6 | {
7 | "id": "d0380fe6-f406-40ed-b723-19975ab3580d",
8 | "url": "https://ll.thespacedevs.com/2.0.0/launch/d0380fe6-f406-40ed-b723-19975ab3580d/",
9 | "launch_library_id": null,
10 | "slug": "new-shepard-ns-13",
11 | "name": "New Shepard | NS-13",
12 | "status": {
13 | "id": 1,
14 | "name": "Go"
15 | },
16 | "net": "2020-09-24T15:00:00Z",
17 | "window_end": "2020-09-24T15:00:00Z",
18 | "window_start": "2020-09-24T15:00:00Z",
19 | "inhold": false,
20 | "tbdtime": false,
21 | "tbddate": false,
22 | "probability": null,
23 | "holdreason": "",
24 | "failreason": "",
25 | "hashtag": null,
26 | "launch_service_provider": {
27 | "id": 141,
28 | "url": "https://ll.thespacedevs.com/2.0.0/agencies/141/",
29 | "name": "Blue Origin",
30 | "type": "Commercial"
31 | },
32 | "rocket": {
33 | "id": 2793,
34 | "configuration": {
35 | "id": 137,
36 | "launch_library_id": 9999,
37 | "url": "https://ll.thespacedevs.com/2.0.0/config/launcher/137/",
38 | "name": "New Shepard",
39 | "family": "Blue Origin",
40 | "full_name": "New Shepard",
41 | "variant": ""
42 | }
43 | },
44 | "mission": {
45 | "id": 1191,
46 | "launch_library_id": null,
47 | "name": "NS-13",
48 | "description": "This will be the 13th New Shepard mission...",
49 | "launch_designator": null,
50 | "type": "Suborbital",
51 | "orbit": {
52 | "id": 15,
53 | "name": "Sub-Orbital",
54 | "abbrev": "Sub Orbital"
55 | }
56 | },
57 | "pad": {
58 | "id": 90,
59 | "url": "https://ll.thespacedevs.com/2.0.0/pad/90/",
60 | "agency_id": 141,
61 | "name": "West Texas Suborbital Launch Site/ Corn Ranch",
62 | "info_url": "http://www.blueorigin.com",
63 | "wiki_url": "https://en.wikipedia.org/wiki/Corn_Ranch",
64 | "map_url": "https://www.google.com/maps/place/31%C2%B025'22.4%22N+104%C2%B045'25.6%22W",
65 | "latitude": "31.422878000000000",
66 | "longitude": "-104.757121000000000",
67 | "location": {
68 | "id": 29,
69 | "url": "https://ll.thespacedevs.com/2.0.0/location/29/",
70 | "name": "Corn Ranch, USA",
71 | "country_code": "USA",
72 | "map_image": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/launch_images/location_29_20200803142436.jpg",
73 | "total_launch_count": 12,
74 | "total_landing_count": 0
75 | },
76 | "map_image": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/launch_images/pad_90_20200803143233.jpg",
77 | "total_launch_count": 12
78 | },
79 | "webcast_live": false,
80 | "image": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/launch_images/new2520shepard_image_20200922210608.jpeg",
81 | "infographic": null,
82 | "program": []
83 | }
84 | ]
85 | }
--------------------------------------------------------------------------------
/tests/data/launcher.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 137,
3 | "launch_library_id": 9999,
4 | "url": "https://ll.thespacedevs.com/2.0.0/config/launcher/137/",
5 | "name": "New Shepard",
6 | "description": "The New Shepard reusable launch system is a vertical-takeoff, vertical-landing (VTVL), suborbital manned rocket that is being developed by Blue Origin as a commercial system for suborbital space tourism.",
7 | "family": "Blue Origin",
8 | "full_name": "New Shepard",
9 | "manufacturer": {
10 | "id": 141,
11 | "url": "https://ll.thespacedevs.com/2.0.0/agencies/141/",
12 | "name": "Blue Origin",
13 | "featured": true,
14 | "type": "Commercial",
15 | "country_code": "USA",
16 | "abbrev": "BO",
17 | "description": "Blue Origin is an American privately funded aerospace manufacturer and spaceflight services company set up by Amazon.com founder Jeff Bezos with its headquarters in Kent, Washington. The company is developing technologies to enable private human access to space with the goal to dramatically lower costs and increase reliability. Blue Origin currently launches its New Shepard sub-orbital vehicle from its West Texas launch site, they are currently constructing a launch pad for their orbital vehicle New Glenn at Cape Canaveral LC-36.",
18 | "administrator": "CEO: Jeff Bezos",
19 | "founding_year": "2000",
20 | "launchers": "New Shepard | New Glenn",
21 | "spacecraft": "",
22 | "launch_library_url": "https://launchlibrary.net/1.4/agency/141",
23 | "total_launch_count": 12,
24 | "consecutive_successful_launches": 12,
25 | "successful_launches": 12,
26 | "failed_launches": 0,
27 | "pending_launches": 1,
28 | "consecutive_successful_landings": 11,
29 | "successful_landings": 11,
30 | "failed_landings": 1,
31 | "attempted_landings": 12,
32 | "info_url": "http://www.blueorigin.com/",
33 | "wiki_url": "http://en.wikipedia.org/wiki/Blue_Origin",
34 | "logo_url": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/logo/blue2520origin_logo_20190207032427.png",
35 | "image_url": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/agency_images/blue2520origin_image_20190207032427.jpeg",
36 | "nation_url": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/agency_nation/blue2520origin_nation_20190207032428.jpeg"
37 | },
38 | "program": [],
39 | "variant": "",
40 | "alias": "",
41 | "min_stage": 1,
42 | "max_stage": 1,
43 | "length": 15.0,
44 | "diameter": 3.7,
45 | "maiden_flight": "2015-04-29",
46 | "launch_mass": 75,
47 | "leo_capacity": 0,
48 | "gto_capacity": 0,
49 | "to_thrust": 490,
50 | "apogee": 100,
51 | "vehicle_range": null,
52 | "image_url": "https://spacelaunchnow-prod-east.nyc3.digitaloceanspaces.com/media/launcher_images/new2520shepard_image_20190207032624.jpeg",
53 | "info_url": "https://www.blueorigin.com/new-shepard/",
54 | "wiki_url": "https://en.wikipedia.org/wiki/New_Shepard",
55 | "total_launch_count": 12,
56 | "consecutive_successful_launches": 12,
57 | "successful_launches": 12,
58 | "failed_launches": 0,
59 | "pending_launches": 1
60 | }
--------------------------------------------------------------------------------
/tests/test_nextinspace.py:
--------------------------------------------------------------------------------
1 | # type: ignore
2 |
3 | import copy
4 | from datetime import MINYEAR, datetime, timedelta, timezone
5 |
6 | import pytest
7 | from pytest_lazy_fixtures import lf
8 |
9 | import nextinspace
10 | from nextinspace import BASE_URL
11 |
12 |
13 | @pytest.mark.parametrize(
14 | "example",
15 | [
16 | lf("example_event"),
17 | lf("example_launcher"),
18 | lf("example_launch_verbose"),
19 | ],
20 | )
21 | def test_eq(example):
22 | assert example == copy.copy(example)
23 |
24 |
25 | @pytest.mark.parametrize(
26 | "target_length_merged_list, expected_result",
27 | [
28 | (5, [1, 2, 2, 3, 4]),
29 | (14, [1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 10, 12, 14]),
30 | (21, [1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 10, 12, 14]),
31 | ],
32 | )
33 | def test_merge_sorted_sequences(list_1, list_2, target_length_merged_list, expected_result):
34 | result = nextinspace.merge_sorted_sequences(list_1, list_2, target_length_merged_list)
35 | result_only_nums = [holder.date.year for holder in result]
36 |
37 | assert result_only_nums == expected_result
38 |
39 |
40 | @pytest.mark.parametrize(
41 | "pad, pad_loc, result",
42 | [
43 | ("Pad", "Location", "Pad, Location"),
44 | (None, "Location", "Location"),
45 | (None, None, None),
46 | ("Pad", None, "Pad"),
47 | ],
48 | )
49 | def test_build_location_string(pad, pad_loc, result):
50 | assert nextinspace.build_location_string(pad, pad_loc) == result
51 |
52 |
53 | @pytest.mark.parametrize(
54 | "datetime_str, result",
55 | [
56 | (None, datetime(MINYEAR, 1, 1)),
57 | (
58 | "2020-09-24T15:00:00Z",
59 | # Don't run this test if you are not on Eastern time!
60 | datetime(2020, 9, 24, 11, 0, tzinfo=timezone(timedelta(days=-1, seconds=72000), "EDT")),
61 | ),
62 | ],
63 | )
64 | def test_date_str_to_datetime(datetime_str, result):
65 | FORMAT_STRING = "%Y-%m-%dT%H:%M:%SZ"
66 | print(nextinspace.date_str_to_datetime(datetime_str, FORMAT_STRING))
67 | assert nextinspace.date_str_to_datetime(datetime_str, FORMAT_STRING) == result
68 |
69 |
70 | @pytest.mark.parametrize(
71 | "launch, include_launcher",
72 | [
73 | (lf("example_launch_verbose"), True),
74 | (lf("example_launch_normal"), False),
75 | ],
76 | )
77 | def test_next_launch(requests_mock, example_launch_text, launch, include_launcher, example_launcher_text):
78 | # Mock API
79 | now = datetime.utcnow()
80 | requests_mock.get(
81 | f"{BASE_URL}/launch?limit=1&net__gte=" + now.strftime("%Y-%m-%dT%H:%M:%SZ"),
82 | text=example_launch_text,
83 | )
84 | # Make sure the request from the nested get_launcher call is intercepted
85 | requests_mock.get("https://ll.thespacedevs.com/2.0.0/config/launcher/137/", text=example_launcher_text)
86 |
87 | # Get result of function
88 | result_launch = nextinspace.next_launch(1, include_launcher)[0]
89 |
90 | assert result_launch == launch
91 |
92 |
93 | def test_get_launcher(requests_mock, example_launcher_text, example_launcher):
94 | # Mock API
95 | launcher_url = "https://ll.thespacedevs.com/2.0.0/config/launcher/137/"
96 | requests_mock.get(launcher_url, text=example_launcher_text)
97 |
98 | # Get result of function
99 | launcher = nextinspace.get_launcher(launcher_url)
100 |
101 | assert launcher == example_launcher
102 |
103 |
104 | def test_next_event(requests_mock, example_event_text, example_event):
105 | # Mock API
106 | requests_mock.get(f"{BASE_URL}/event/upcoming?limit=1", text=example_event_text)
107 |
108 | # Get result of function
109 | event = nextinspace.next_event(1)[0]
110 |
111 | assert event == example_event
112 |
113 |
114 | def test_nextinspace(
115 | requests_mock, example_launch_text, example_event_text, example_launcher_text, example_event, example_launch_normal
116 | ):
117 | # Mock API (Launch)
118 | now = datetime.utcnow()
119 | requests_mock.get(
120 | f"{BASE_URL}/launch?limit=2&net__gte=" + now.strftime("%Y-%m-%dT%H:%M:%SZ"),
121 | text=example_launch_text,
122 | )
123 | # Make sure the request from the nested get_launcher call is intercepted
124 | requests_mock.get(f"{BASE_URL}/config/launcher/137/", text=example_launcher_text)
125 |
126 | # Mock API (Event)
127 | requests_mock.get(f"{BASE_URL}/event/upcoming?limit=2", text=example_event_text)
128 |
129 | next = nextinspace.nextinspace(2)
130 |
131 | assert next == (example_event, example_launch_normal)
132 |
--------------------------------------------------------------------------------