A slightly opinionated template for iPython configuration for interactive development

Overview

ipython-profile

A slightly opinionated template for iPython configuration for interactive development. Auto-reload and no imports for packages and modules in the project.

Example usage

Usage

Install the library using your favorite package manager:

# With poetry
poetry add ipython-profile

# With pip
pip install ipython-profile

Now you can use ipython-profile in the project directory:

$ cd ~/awesome-project
$ ipython-profile            # If installed with pip
$ poetry run ipython-profile # If installed locally with poetry
[ipython-profile] Created .ipython-profile directory with default config.
[ipython-profile] It seems that you are using git in this project. Consider adding .ipython-profile to .gitignore.
Python 3.9.6 (default, Jun 29 2021, 05:25:02)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.0.1 -- An enhanced Interactive Python. Type '?' for help.

IPython profile: .ipython-profile

In [1]:

It loads modules automatically (magic!) if the called name wasn't found in the environment using ipython-autoimport.

It also automatically reloads modules on changes using iPython autoreload extension.

In [1]: requests.get('https://google.com/')
Autoimport: import requests
Out[1]: <Response [200]>

In [2]: libs.auth.get_token()
Autoimport: import libs
Autoimport: import libs.auth
Out[2]: 1

In [3]: # I'm changing libs/auth.py

In [4]: libs.auth.get_token()
Out[4]: 2

ipython-profile by default creates an iPython profile directory in ./.ipython-profile. If you want to set a different directory, use --profile-dir option.

How it works?

The template is small and straightforward underneath: it installs ipython-autoimport and creates this iPython configuration file:

## lines of code to run at IPython startup.
#  Default: []
c.InteractiveShellApp.exec_lines = [
    '%autoreload 2'
]

## A list of dotted module names of IPython extensions to load.
#  Default: []
c.InteractiveShellApp.extensions = ['autoreload', 'ipython_autoimport']

Basically, it enables auto-import and auto-reload for all modules.

In the future the profile might include some tools to simplify using it with web frameworks (Django, FastAPI) and testing frameworks.

Owner
Seva Zhidkov
Co-founder & CEO at Clic (joinclic.io). Previously: SWE @ vk.com, angel.co. Created Clever app: live trivia in Russia, 12M installs.
Seva Zhidkov
Python 3+ compatible port of the configobj library

configobj Python 3+ compatible port of the configobj library. Documentation You can find a full manual on how to use ConfigObj at readthedocs. If you

Differently Sized Kittens 288 Dec 14, 2022
A Python library to parse PARI/GP configuration and header files

pari-utils A Python library to parse PARI/GP configuration and header files. This is mainly used in the code generation of https://github.com/sagemath

Sage Mathematical Software System 3 Sep 18, 2022
Strict separation of config from code.

Python Decouple: Strict separation of settings from code Decouple helps you to organize your settings so that you can change parameters without having

Henrique Bastos 2.3k Dec 30, 2022
Yamale (ya·ma·lē) - A schema and validator for YAML.

Yamale (ya·ma·lē) ⚠️ Ensure that your schema definitions come from internal or trusted sources. Yamale does not protect against intentionally maliciou

23andMe 534 Dec 21, 2022
🤫 Easily manage configs and secrets in your Python projects (with CLI support)

Installation pip install confidential How does it work? Confidential manages secrets for your project, using AWS Secrets Manager. First, store a secr

Candid™️ 63 Oct 30, 2022
Configuration Management for Python ⚙

dynaconf - Configuration Management for Python. Features Inspired by the 12-factor application guide Settings management (default values, validation,

Bruno Rocha 2.8k Jan 06, 2023
ConfZ is a configuration management library for Python based on pydantic.

ConfZ – Pydantic Config Management ConfZ is a configuration management library for Python based on pydantic. It easily allows you to load your configu

Zühlke 164 Dec 27, 2022
Read configuration settings from python configuration files.

Maison Read configuration settings from python configuration files. Motivation When developing a python application, e.g a command-line tool, it can b

9 Jan 04, 2023
Configuration for Python planets

Configuration for Python planets

Python 127 Dec 16, 2022
A YAML validator for Programming Historian lessons.

phyaml A simple YAML validator for Programming Historian lessons. USAGE: python3 ph-lesson-yaml-validator.py lesson.md The script automatically detect

Riva Quiroga 1 Nov 07, 2021
This Ivy plugin adds support for TOML file headers.

This Ivy plugin adds support for TOML file headers as an alternative to YAML.

Darren Mulholland 1 Nov 09, 2021
Napalm-vs-openconfig - Comparison of NAPALM and OpenConfig YANG with NETCONF transport

NAPALM vs NETCONF/OPENCONFIG Abstracts Multi vendor network management and autom

Anton Karneliuk 1 Jan 17, 2022
sqlconfig: manage your config files with sqlite

sqlconfig: manage your config files with sqlite The problem Your app probably has a lot of configuration in git. Storing it as files in a git repo has

Pete Hunt 4 Feb 21, 2022
Dynamic Django settings.

Constance - Dynamic Django settings A Django app for storing dynamic settings in pluggable backends (Redis and Django model backend built in) with an

Jazzband 1.5k Jan 04, 2023
A modern simfile parsing & editing library for Python 3

A modern simfile parsing & editing library for Python 3

ash garcia 38 Nov 01, 2022
Generate config files and qr codes for wireguard vpn

wireguard config generator for python Generate config files and qr codes for wireguard vpn You will need to install qrcode and pillow in python and yo

18 Dec 02, 2022
A tool to manage configuration files, build scripts etc. across multiple projects.

A tool to manage configuration files, build scripts etc. across multiple projects.

8 Dec 14, 2022
Dag-bakery - Dag Bakery enables the capability to define Airflow DAGs via YAML.

DAG Bakery - WIP 🔧 dag-bakery aims to simplify our DAG development by removing all the boilerplate and duplicated code when defining multiple DAG cro

Typeform 2 Jan 08, 2022
Scooch Configures Object Oriented Class Hierarchies for python

Scooch Scooch Configures Object Oriented Class Hierarchies for python. A good place to start with Scooch is at the documentation found here. Scooch is

Pandora Media, Inc. 6 Dec 20, 2022
Event Coding for the HV Protocol MEG datasets

Scripts for QA and trigger preprocessing of NIMH HV Protocol Install pip install git+https://github.com/nih-megcore/hv_proc Usage hv_process.py will

2 Nov 14, 2022