This project is based on the algorithms found in Practical Astronomy with your Calculator or Spreadsheet by Peter Duffett-Smith and Jonathan Zwart.
This is a library of functions, with unit tests, written in Python 3.12, the standard library, unittest framework, and the math module.
All credit for the accuracy and usefulness of these algorithms goes to the original authors.
Test
To run all tests run this command:
python -m unittest
Local Development Setup
Start/Activate a Virtual Environment
Start:
python3 -m venv venv
Activate:
source venv/bin/activate
On Windows
venv\Scripts\activate
Install dependencies
pip install --upgrade -r requirements.txt
Installation
pip install af_practical_astronomy
Running
Currently, you will have to manually import these functions into your project if you wish.
TODO
- Finish implementing all of the algorithms from the book.
- Note: skipped section 31, matrix method for coordinate conversions. Will implement later.
- Add a test runner.
- Tidy up
float()casts
Updating and Repackaging the Project with setuptools
To update and repackage this Python project using setuptools on macOS, follow these steps:
1. Install or Activate the Virtual Environment
It's recommended to use a virtual environment for isolation. If you don't already have a virtual environment, create and activate one:
Create and start virtual environment:
python3 -m venv venv
source venv/bin/activate
2. Install Required Dependencies
Ensure that setuptools and wheel are installed in your environment:
pip install -r requirements.txt
3. Update version number
setup(
version="0.2.0", # Update this to the new version number
...
)
4. Build the dist
python setup.py sdist bdist_wheel
5. Upload with twine
twine upload dist/*
And enter in the API token when prompted
Metadata
Release files for af-practical-astronomy 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| af_practical_astronomy-1.1.0.tar.gz | 13.1 kB | Without provenance | Details for af_practical_astronomy-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| af_practical_astronomy-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for af_practical_astronomy-1.1.0-py3-none-any.whl |
Total release size: 23.1 kB
Release files / af_practical_astronomy-1.1.0.tar.gz
| Download URL | af_practical_astronomy-1.1.0.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12c66f97cc7257ddd2a7f6d9b3043d51c49325fe498ac168a7b8051d4e3614f3
|
|
BLAKE2b-256 checksum How to use checksums |
be68303c66cfb387adaa6b33402ef9fc68e5bdf4fff530bfe2a7d2a9bbd948de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / af_practical_astronomy-1.1.0-py3-none-any.whl
| Download URL | af_practical_astronomy-1.1.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d464a8e5ce6c376278841182a58cb05391f2d0d41d01ef10a7770d461aca88e
|
|
BLAKE2b-256 checksum How to use checksums |
4c98f586d5f8e7e6cd94cdd0d252374c301b5b622b9112b23e72d8e7a4ad6519
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for af-practical-astronomy 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.