semvec/pypi-packages huggingface dataset:
django-multi-auth-token 1.0.0
A Django package that allows multi token authentication for Django Rest Framework(DRF)
License: MIT License


django-multi-auth-token

This package allows multi token authentication for Django Rest Framework(DRF)


Quick start
-----------
1. Add "multi_auth_token" to your INSTALLED_APPS setting like this::
``
INSTALLED_APPS = [
...
'multi_auth_token',
]
``

2. Add "multi_auth_token.authentication.MultiTokenAuthentication" to "DEFAULT_AUTHENTICATION_CLASSES" like this:
``
REST_FRAMWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'multi_auth_token.authentication.MultiTokenAuthentication',
...
]
}
``

3. Migrate
``
python manage.py migrate
``


IMPORTANT
---------
1. DO NOT add "rest_framework.authtoken" to your INSTALLED_APPS.
2. DO NOT add "rest_framework.authentication.TokenAuthentication" to DEFAULT_AUTHENTICATION_CLASSES


TODO
----


Changelog
---------
1.0.0 - 2023-03-01 Arindam Dutta - First release


Copyright(c) 2023 Arindam Dutta
ngspicehlp 0.0.1
ngspice helper
License: MIT License
Requires Python: >=3.11
Keywords: ngspice,spice,simulation

# Ngspice Helper
Lightweight Python interface to ngspice

# Movtivation
[Ngspice](https://ngspice.sourceforge.io/) is an open source circuit simulator with a command line interface (CLI). It's natural to use Python to interact with the CLI, making it easier to use ngspice for advanced design analysis.

There exists a simulator called [PySpice](https://github.com/PySpice-org/PySpice) which embeds ngspice through its API. ***Ngspice Helper***, on the other hand, is a lightweight module that facilitates ngspice interaction. Simple classes and functions transparently create ngspice netlists and commands. You can launch multiple analyses and convert the results to [Pandas](https://pandas.pydata.org/) and [Numpy](https://numpy.org/), enabling downstream computation or plotting with [Matplotlib](https://matplotlib.org/).

A modest knowledge of ngspice and Python is assumed.

# Usage
Ngspice Helper requires an ngspice design, either in the form of a netlist or a [KiCad](https://www.kicad.org/) (version 7.0 or higher) schematic.

Ngspice can be used in many different ways. However, Ngspice Helper will interface to ngspice only through the CLI in non-interactive mode. It creates a *control section* that will execute simulations in batch mode. Results from the simulation will be converted to [Pandas](https://pandas.pydata.org/) DataFrames.


# Typical Program Flow
A main Python program controls the flow. An example can be found [here](https://github.com/astorguy/bc546_amp).

1. import ngspicehlp

1. Specify paths to KiCad and ngspice executables, and project directory

1. Define signals of interest (node voltage, currents, etc.) with `Vectors` objects

1. Use a `KicadCmd` object to extract and condition a netlist from a schematic

1. Define one or more analyses (op, dc, tr, ac) with `Analyses` objects

1. A `Control` object defines the control section. The analyses and other control functions are part of it.

1. A `Simulation` Object is created and executed.

1. The tabular results from the simulation are converted to Pandas DataFrames

1. A Plot object can be used to encapsulate Matplotlib to view the results.

# Installation

1. install package:

`python -m pip install git+https://github.com/astorguy/ngspicehlp_project`

2. Download this [example](https://github.com/astorguy/bc546_amp) (a bipolar amplifier) to try out the `ngspicehlp` package.