osint_envs
osint_envs is a tiny helper that prepares your project for OpenAI and Telegram integrations.
It locates your project root, loads or creates a .env, validates required credentials and
prompts you to fill in anything missing. The resulting configuration is returned as a simple
dataclass so your scripts can immediately wire clients and continue.
Features
-
Auto-detects project root and reads/writes a
.envfile -
Validates presence and format of:
OPENAI_API_KEYTELEGRAM_API_IDTELEGRAM_API_HASH
-
Interactively prompts for any missing/invalid values
-
Writes/updates
.envat your project root and attempts to set permissions to600(owner read/write only) -
Ensures
.envis added to.gitignore -
Provides
init()for scripts and a CLIosint-env-setup -
Supports non-interactive mode via
OSINT_ENVS_NONINTERACTIVE=1to fail fast when values are missing
Installation
pip install -e .
# or: pip install osint-envs # if published on PyPI
Usage
Interactive script
from osint_envs import init
def main():
cfg = init() # prompts for missing values
from telethon import TelegramClient
client = TelegramClient("session_name", int(cfg.telegram_api_id), cfg.telegram_api_hash)
# continue using client or other services
if __name__ == "__main__":
main()
CLI setup
osint-env-setup --help # usage and instructions
osint-env-setup # interactive setup
# or
python -m osint_envs.handler
Headless / CI
import os
from osint_envs import init
# Disable prompts and raise RuntimeError if a value is missing
os.environ["OSINT_ENVS_NONINTERACTIVE"] = "1"
cfg = init()
Tips & Notes
- The
.envfile is local to your project and should never be committed. - Its permissions are set to
600(read/write for the owner only) when possible; adjust manually if your platform doesn't support it. - Sensitive prompts use
getpass.getpass()so secrets aren't echoed to the terminal. - For OpenAI usage, create a client after calling
init():
from openai import OpenAI
cfg = init()
client = OpenAI(api_key=cfg.openai_api_key)
- Telethon sessions may prompt for 2FA on first run; subsequent runs reuse the session file.
Security considerations
- Values written to
.envare sanitized to remove control characters. - Ensure
.envremains out of version control and shared repositories. - Avoid printing full secrets to logs; redact or shorten when necessary.
osint_envs keeps repeated boilerplate out of your agents, CLIs and scripts, letting you focus on the actual OSINT logic.
Metadata
Release files for osint-envs 0.1.1
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 |
|---|---|---|---|---|
| osint_envs-0.1.1.tar.gz | 12.0 kB | Without provenance | Details for osint_envs-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| osint_envs-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for osint_envs-0.1.1-py3-none-any.whl |
Total release size: 22.7 kB
Release files / osint_envs-0.1.1.tar.gz
| Download URL | osint_envs-0.1.1.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e76016c05a122aff8033dba1f5992bfa6e77d1fe65116c595bfeb9365bda1a4
|
|
BLAKE2b-256 checksum How to use checksums |
4fce1ffdeee5019bf2845fedb669a37fd7732c6e95b0ec9a2887335cfb5c60e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Release files / osint_envs-0.1.1-py3-none-any.whl
| Download URL | osint_envs-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e546b119633844cb092dd9fa19186e023f9788dcf33abc5aebdf1b8e716535eb
|
|
BLAKE2b-256 checksum How to use checksums |
2ba334c71cdbb4e0c168f8048a87fd21f619cc5d9e19011e9f95d0de4043324a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Security for osint-envs 0.1.1
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.