
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Python environment variable management made simple.
OneEnv automatically discovers environment variable templates from your installed packages and manages them with namespaces.
Organize environment templates by categories (Database, VectorStore, LLM, etc.) with structured discovery and selective generation.
Automatically collect environment variable templates from all installed packages - no manual configuration required.
Organize environment variables by service/component with intelligent fallback.
Programmatic access to template structure for building custom scaffolding tools and integrations.
pip install oneenv
oneenv template
# View all available categories and options
oneenv template --structure
# Get detailed info for a specific category
oneenv template --info Database
# Preview a specific option
oneenv template --preview Database postgres
# Generate custom configuration
oneenv template --generate Database:postgres VectorStore:chroma
import oneenv
# Load different environments
oneenv.env().load_dotenv("common.env")
oneenv.env("database").load_dotenv("database.env")
oneenv.env("web").load_dotenv("web.env")
# Get values with namespace fallback
db_host = oneenv.env("database").get("HOST", "localhost")
web_port = oneenv.env("web").get("PORT", "8000")
timeout = oneenv.env("database").get("TIMEOUT", "30") # Falls back to common
Before OneEnv:
# Scattered environment variables
DATABASE_URL = os.getenv("DATABASE_URL")
WEB_HOST = os.getenv("WEB_HOST")
API_KEY = os.getenv("API_KEY")
After OneEnv:
# Organized by namespace
db_url = oneenv.env("database").get("URL")
web_host = oneenv.env("web").get("HOST")
api_key = oneenv.env("api").get("KEY")
.env.example
filesOneEnv's intelligent scaffolding system organizes templates by categories and provides powerful APIs for custom tool development:
# Discover available templates
oneenv template --structure
# Get category details with variable counts
oneenv template --info Database
# Preview what variables an option provides
oneenv template --preview Database postgres
# Generate templates with specific selections
oneenv template --generate Database:postgres VectorStore:chroma LLM:openai
# JSON output for automation
oneenv template --structure --json
Build sophisticated scaffolding tools using OneEnv's comprehensive APIs:
import oneenv
# Discovery API
structure = oneenv.get_all_template_structure()
print("Available categories:", list(structure.keys()))
# Output: {'Database': ['postgres', 'sqlite'], 'VectorStore': ['chroma', 'pinecone']}
# Validation API
if oneenv.has_category("Database"):
options = oneenv.get_options("Database")
print(f"Database options: {options}")
# Information API
info = oneenv.get_category_info("Database")
print(f"Total variables: {info['total_variables']}")
print(f"Critical variables: {info['critical_variables']}")
# Preview API
preview = oneenv.get_option_preview("Database", "postgres")
for var_name, config in preview['variables'].items():
print(f"{var_name}: {config['importance']} - {config['description']}")
# Generation API
selections = [
{"category": "Database", "option": "postgres"},
{"category": "VectorStore", "option": "chroma"},
{"category": "LLM", "option": "openai"}
]
content = oneenv.generate_template(".env.example", selections)
print("Generated custom template with selected components!")
Developers can create discoverable templates using the new scaffolding format:
# mypackage/templates.py
def database_template():
return [
{
"category": "Database",
"option": "postgres",
"env": {
"DATABASE_URL": {
"description": "PostgreSQL connection URL",
"default": "postgresql://user:pass@localhost:5432/dbname",
"required": True,
"importance": "critical"
},
"DATABASE_POOL_SIZE": {
"description": "Connection pool size",
"default": "10",
"required": False,
"importance": "important"
}
}
},
{
"category": "Database",
"option": "sqlite",
"env": {
"DATABASE_URL": {
"description": "SQLite database file path",
"default": "sqlite:///app.db",
"required": True,
"importance": "critical"
}
}
}
]
Register in pyproject.toml
:
[project.entry-points."oneenv.templates"]
database = "mypackage.templates:database_template"
Key Features:
oneenv template --structure
Start here: Step 1: Basic dotenv Usage
MIT License
FAQs
OneEnv: Environment variable management and generation tool
We found that oneenv demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.