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
A set of Python scripts and notebooks to help administer and configure Workforce projects.

Workforce Scripts A set of Python scripts and notebooks to help administer and configure Workforce projects. Notebooks Several example Jupyter noteboo

Esri 75 Sep 09, 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
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
An application pulls configuration information from JSON files generated

AP Provisioning Automation An application pulls configuration information from JSON files generated by Ekahau and then uses Netmiko to configure the l

Cisco GVE DevNet Team 1 Dec 17, 2021
A compact library for Python 3.10x that allows users to configure their SimPads real-time

SimpadLib v1.0.6 What is this? This is a python library programmed by Ashe Muller that allows users to interface directly with their SimPad devices, a

Ashe Muller 2 Jan 08, 2022
Secsie is a configuration language made for speed, beauty, and ease of use.

secsie-conf pip3 install secsie-conf Secsie is a configuration language parser for Python, made for speed and beauty. Instead of writing config files

Noah Broyles 3 Feb 19, 2022
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
A modern simfile parsing & editing library for Python 3

A modern simfile parsing & editing library for Python 3

ash garcia 38 Nov 01, 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
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
Apt2sbom python package generates SPDX or YAML files

Welcome to apt2sbom This package contains a library and a CLI tool to convert a Ubuntu software package inventory to a software bill of materials. You

Eliot Lear 15 Nov 13, 2022
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
MOHAconfig - Gerador de arquivo de configuraĆ§Ć£o para Medal of Honor: Airborne

MOHAconfig Gerador de arquivo de configuraĆ§Ć£o para Medal of Honor: Airborne MOHA - Gerador de arquivo de configuraĆ§Ć£o. Essa aplicaĆ§Ć£o foi feita em pyt

1 Dec 31, 2021
Kubernates Config Manager

Kubernates Config Manager Sometimes we need manage more than one kubernates cluster at the same time. Switch cluster configs is a dangerous and troubl

å‘Øę–‡é˜³ 3 Jan 10, 2022
Inject your config variables into methods, so they are as close to usage as possible

Inject your config variables into methods, so they are as close to usage as possible

GDWR 7 Dec 14, 2022
Sync any your configuration file to remote. Currently only support gist.

Sync your configuration to remote, such as vimrc. You can use EscSync to manage your configure of editor, shell, etc.

Me1onRind 0 Nov 21, 2022
Python-dotenv reads key-value pairs from a .env file and can set them as environment variables.

python-dotenv Python-dotenv reads key-value pairs from a .env file and can set them as environment variables. It helps in the development of applicati

Saurabh Kumar 5.5k Jan 04, 2023
Load Django Settings from Environmental Variables with One Magical Line of Code

DjEnv: Django + Environment Load Django Settings Directly from Environmental Variables features modify django configuration without modifying source c

Daniel J. Dufour 28 Oct 01, 2022
Python YAML Environment (ymlenv) by Problem Fighter Library

In the name of God, the Most Gracious, the Most Merciful. PF-PY-YMLEnv Documentation Install and update using pip: pip install -U PF-PY-YMLEnv Please

Problem Fighter 2 Jan 20, 2022
environs is a Python library for parsing environment variables.

environs: simplified environment variable parsing environs is a Python library for parsing environment variables. It allows you to store configuration

Steven Loria 920 Jan 04, 2023