Simple, interactive .env bootstrapper for OpenAI + Telegram across projects.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osint_envs-0.1.1.tar.gz.
File metadata
- Download URL: osint_envs-0.1.1.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e76016c05a122aff8033dba1f5992bfa6e77d1fe65116c595bfeb9365bda1a4
|
|
| MD5 |
2f8f67db5a4eafbcab841d96a04b4c29
|
|
| BLAKE2b-256 |
4fce1ffdeee5019bf2845fedb669a37fd7732c6e95b0ec9a2887335cfb5c60e9
|
File details
Details for the file osint_envs-0.1.1-py3-none-any.whl.
File metadata
- Download URL: osint_envs-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e546b119633844cb092dd9fa19186e023f9788dcf33abc5aebdf1b8e716535eb
|
|
| MD5 |
501db68f92782c930d1c127b623de115
|
|
| BLAKE2b-256 |
2ba334c71cdbb4e0c168f8048a87fd21f619cc5d9e19011e9f95d0de4043324a
|