CASafari 🚀
A robust, modern web dashboard and interactive telescope automation ecosystem combining Flask, TwitchIO, and N.I.N.A. (Nighttime Imaging 'N' Astronomy).
CASafari features a custom, lightweight, native Python caserver and caclient backend pipeline imported seamlessly as redis to mimic standard Redis libraries—making the entire application 100% cross-platform without requiring external redis-server installations.
🛡️ License & Copyleft Protection
This project is proudly licensed under the GNU Affero General Public License v3.0 (AGPLv3).
What this means for users and developers:
- Open & Collaborative: You are free to fork, clone, modify, and contribute back to this repository.
- No Closed-Source Exploitation: If you modify this project and host it on a network or cloud server as a web application, API, or service, you are legally required to make your entire modified source code available to your users under the exact same AGPLv3 license.
📦 Installation & Setup
Developer Installation (Via Git)
Clone the repository and install it locally in editable mode:
git clone https://github.com/c-astronomy/CASafari
cd CASafari
pip install -e .
⚙️ Configuration Files
Before running the application, ensure your configuration files are properly populated in the root folder:
1. credentials.json
Used by the Twitch bot and web dashboard for API access:
{
"client_id": "your_twitch_client_id",
"client_secret": "your_twitch_client_secret",
"owner_id": "your_owner_id",
"bot_id": "your_bot_id",
"token": "your_oauth_token"
}
2. casafari-config.json
Defines your geographic coordinates, mount tracking boundaries, and N.I.N.A. integration endpoint (Note: N.I.N.A. API port defaults to 1888):
{
"lat": 59.6,
"lon": 16.4903,
"AltLim": 30,
"AltLimMax": 75,
"AzLim": 230,
"AzLimMax": 350,
"expo": 30,
"ip": "localhost:1888",
"platesolve": "false",
"sequence_mode": "false"
}
3. targetlist.json
Contains your celestial targets list, coordinates, and chat trigger commands (e.g., !slew_andromeda).
🎛️ New Features & Master Control Toggles
CASafari includes powerful toggle controls managed directly via the Web Dashboard System Master Control card:
- Automation Engine (Casafari) (
ON/OFF): Manages autonomous target rotation when Twitch chat is idle. - Plate Solve & Center (
ON/OFF): When enabled, both auto-safari and triggered slews (!slew_...) automatically trigger N.I.N.A. plate solving and centering (/framing/center) after slewing. - Sequence Mode (
ON/OFF): When enabled, N.I.N.A. executes full target sequences (/sequence/resetand/sequence/start) instead of standard 5-second preview captures. When disabled, the legacy preview capture method is used. - Chat Command
!stats: Live session telemetry tracking uptime, targets slewed, captures taken, current target, and automation status.
🛠️ Project Architecture
CASafari/
├── .github/
├── src/
│ └── CASafari/
│ ├── __init__.py # Python package initializer
│ ├── caclient.py # Synchronous custom Redis client wrapper
│ ├── caclientasync.py # Asynchronous custom Redis client wrapper
│ ├── casafari-config.json # Observer location, coordinates, and limits
│ ├── casafari.py # Main automation hub & auto-safari loop
│ ├── caserver.py # Native cross-platform Redis-compatible server
│ ├── nina.py # N.I.N.A. API bridge and equipment monitor
│ ├── targetlist.json # Celestial target database & chat triggers
│ ├── tts.py # Experimental Pocket-TTS audio worker
│ ├── twitch.py # TwitchIO chat bot and command router
│ └── webserver.py # Flask master control dashboard UI
├── LICENSE # GNU AGPLv3 License text
├── README.md # Documentation and usage guide
├── pyproject.toml # Package metadata & dependencies
└── requirements.txt # Legacy/additional requirements backup
🚀 Execution & Startup Order
You can start the entire ecosystem with a single command (python run.py), which spawns all background workers and keeps CASafari's terminal output visible for real-time visual monitoring:
python run.py
Or start processes individually:
- Built-in Redis Server (
caserver.py):python caserver.py - Web Dashboard (
webserver.py):python webserver.py(runs on http://0.0.0.0:5000) - N.I.N.A. Automation Bridge (
nina.py):python nina.py(communicates with N.I.N.A. on port1888) - Automation Engine (
casafari.py):python casafari.py - Twitch Chat Bot (
twitch.py):python twitch.py
🤝 Contributing
We welcome community collaborations! Feel free to open a Pull Request or fork the project. All contributions remain protected under the AGPLv3 license.
Metadata
Release files for CASafari 0.1.13
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 |
|---|---|---|---|---|
| casafari-0.1.13.tar.gz | 43.7 kB | With provenance | Details for casafari-0.1.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| casafari-0.1.13-py3-none-any.whl | Python 3 | none | any | Details for casafari-0.1.13-py3-none-any.whl |
Total release size: 90.1 kB
Release files / casafari-0.1.13.tar.gz
| Download URL | casafari-0.1.13.tar.gz |
|---|---|
| Size | 43.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36cf0931fcb6cb8d80c41f416d35c38b237d4cd04d66358924044cdfcea6796b
|
|
BLAKE2b-256 checksum How to use checksums |
f34386b5fc6033db49a86bc424c3c2c5fcb54acc8a677e38199bf311d9766a20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logRelease files / casafari-0.1.13-py3-none-any.whl
| Download URL | casafari-0.1.13-py3-none-any.whl |
|---|---|
| Size | 46.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08d8420f421b8b5382b0b962b8eb03cdb31198c8fe893c6027202374900e51a5
|
|
BLAKE2b-256 checksum How to use checksums |
715a3ec180b74ef232fa04114356fd6ec2f9e531c4a9f8a4493f2a4ddbab087a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logSecurity for CASafari 0.1.13
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for casafari-0.1.13.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logA 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.