Saravanan666/pypi-org huggingface dataset:
Package: middleware-service
Middleware Service PackageMiddleware Service Package to manage the validation of client or server side requests.Note: Please populate the .env file with own SECRET_KEY value into your local development root directory then import the Middleware Service Package for use in local development.set the secret key value in .env file in following way, and changes the value in place of set_own_key_valueSECRET_KEY = set_own_key_valueFor Local Development SetupSystem Requirements for Middleware Service packagePython 3.9+Pip 21.2.4+Install and Create the virtual environment on current Operating System$ pip install virtualenv
$ virtualenv myenvNote: Above command create the myenv virtual environment folder and we can also set another name instead of   myenv. then activate your virtual environment.Check and Upgrade the pip and setuptool packages$ python -m pip install --upgrade pip setuptools wheelInstall the Middleware Service Package in your virtual environment$ pip3 install git+https://github.com/adcuratio/folks-middleware-serviceFor Succesfully Uninstall the Middleware Package$ pip3 uninstall middleware_serviceFor Use Middleware Package In Local DevelopementUse Middleware Package for all the api endpoints.1. Import Middleware Package in following wayimport middleware_servicefrom middleware_service import CustomMiddleware2. Add the Middleware package with your FastApi app inside main.py File, like thisapp = FastAPI()app.add_middleware(CustomMiddleware)3. Add all api router in main.py file by using ,app.include_router(add_api_router)Note: If you want to use Middleware Package for the particular router of the FastApi, then use mount option inside main.py file and add middleware inside sub_main.py file in following way:Use Middleware Package for Paticular api endpoints.1. Import Middleware Package in following wayimport middleware_servicefrom middleware_service import CustomMiddleware2. Add the Middleware package with your FastApi app inside main.py File if you wants to add for particular api routes, like thisapp = FastAPI()middleware_object = CustomMiddlewaremiddleware_object.add_router(router=add_api_router_name)app.add_middleware(middleware_object)3. Add all api router in main.py file by using ,app.include_router(add_api_router)
Package: midea
# midea-ac-py [![Build Status](https://travis-ci.org/NeoAcheron/midea-ac-py.svg?branch=master)](https://travis-ci.org/NeoAcheron/midea-ac-py)This is a library to allow communicating to a Midea AC via the Midea Cloud.This is a very early release, and comes without any guarantees. This is still an early work in progress and simply serves as a proof of concept.This library would not have been possible if it wasn’t for the amazing work done by @yitsushi and his Ruby based command line tool.
You can find his work here:https://github.com/yitsushi/midea-air-conditionThe reasons for me converting this to Python is that this library also serves as a platform component for Home Assistant.## Wiki
Please visit the Wiki for device support and instruction on how to use this component:https://github.com/NeoAcheron/midea-ac-py/wiki
Package: midea-andersonshatch
This is an updated version of the library component only, from the repo atNeoAcheron/midea-ac-py.So far, the only changes are to handle the session timeout properly. It should recover from an invalidated session or use of your account on another device.It is used by the home-assistant custom component atandersonshatch/midea-ac-pyOriginal Readme:midea-ac-pyThis is a library to allow communicating to a Midea AC via the Midea Cloud.This is a very early release, and comes without any guarantees. This is still an early work in progress and simply serves as a proof of concept.This library would not have been possible if it wasn't for the amazing work done by @yitsushi and his Ruby based command line tool.
You can find his work here:https://github.com/yitsushi/midea-air-conditionThe reasons for me converting this to Python is that this library also serves as a platform component for Home Assistant.WikiPlease visit the Wiki for device support and instruction on how to use this component:https://github.com/NeoAcheron/midea-ac-py/wiki
Package: midgard
Midgard, the Python Geodesy libraryMidgard is a collection of useful Python utilities used by the Geodetic
institute at the Norwegian Mapping Authority (Kartverket). Although some of
these are geodesy-specific, many are also useful in more general settings.Note:Midgard is still in pre-alpha status. Its functionality will change,
and it should not be depended on in any production-like setting.Installing MidgardMidgard is available atPyPI. You can
install it by simply runningpython -m pip install midgardInstalling Midgard from sourceMidgard depends on several other brilliant Python packages, like for instance
numpy, scipy, etc. We recommend using the Anaconda distribution to ease
the installation of these dependencies.Install AnacondaGo towww.anaconda.com/download, and
download Anaconda for Python 3.Download the Midgard source codeIf you have not already done so, download the Midgard source code from Github:github.com/kartverket/midgard. Then
enter the mainmidgarddirectory before running the install command below.cd midgardInstall dependenciesYou should now install the necessary dependencies using theenvironment.yml-file. You can do this either in your current conda
environment, or choose to create a newmidgard-environment. In order to usemidgardin other projects you need to installmidgardin the same
environment as those projects.To installmidgardin your current environment, doconda env update -f environment.ymlTo installmidgardin a new environment namedmidgardand activate it, doconda env create -n midgard -f environment.yml
conda activate midgardInstall the Midgard packageTo do the actual installation of Midgard, use theflitpackaging tool:python -m flit install --dep productionIf you want to develop the Midgard package, install it in editable mode usingpython -m flit install -sOn Windows, you can install in editable mode usingpython -m flit install --pth-fileUsing MidgardMidgard comes organized into different subpackages. To see info about the
different subpackages, use the Python help system:>>> import midgard
>>> help(midgard)Information about individual subpackages is also available on theMidgard website.
Package: midgard-client
The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.  # noqa: E501
Package: midgard-discord
Midgard Discord botMidgardis a private OpenStack cloud for VAIT testing, training, and development purpose. This project aims to simplify and allow quick provisioning of OpenStack VM using an opinionated workflow entirely through Discord, following a ChatOps model.MotivationsMidgardis an OpenStack lab running entirely on-premise. While it has NAT connectivity, the sticking point is how to direct ingress point to the VMs provisioned inside the lab.For most teaching lab, the users do not deviate from a standard configuration.The resource should be accessible to most users so beginners and professionals alike can quickly provision, experiment and shutdown their solutions.We want to avoid running jumpboxes.We want to avoid installing any VPN solution.We want to avoid software client dependencies, access should simply be SSH into the VM.Software ArchitectureThe software architecture for the bot is as followed:Users will interface with the MidgardLab entirely through Discord slash commands.The Discord bot will communicate with the OpenStack API on the users' behalf to setup an account, register public key and provision VM.The Discord bot will also setup Cloudflare DNS tunnels to allow users to SSH into the VMs provisioned.UsageRun the bot with the following command:poetryrunmidgardContributingSeeCONTRIBUTING.mdfor more information.LicenseThis project is licensed under the terms of theMIT license.
Package: midgy
midgymidgytransforms markdown to python modules and scripts.command line interfacemidgyREADME.md# run a readme file as pythonmidgyrunREADME.md# run a readme file as pythonmidgy-mREADME# run a readme file as python>>> from midgy.run import Markdown
  >>> with Markdown():
  ...   import README
  >>> print(README)
  <module 'README' from '...README.md'>midgyis one half ofpidgy, together they bring literate programming and computing afforandances to [python] and [IPython].midgyis only concerned with the half of literate programming that translates a document to compiled code.midgyhas a small api:md_to_python- a function that converts a markdown document to pythonPython- a class that parses a markdown document and renders pythonmidgy.run.Markdown- is animportnbcontext manager that includes markdown documents when importing python modules.tangling literate programsliterate programming is paradigm that treats code as literate, and vice versa; documents are evaluated on their literary and computational qualities. there are two actions defined in the framework of literate programming:render
: the act of translating the document into a programming language
:midgyrenders markdown to pythonweave
: the act of translating the document to a rendered format
:pidgyweaves markdown to html, pdf, or md through thejinja2template system.midgyfocuses only on therenderactions, and is extended inpidgywhich implements the weave action.extending the lexical analysis of CommonMark markdownmidgyextends the commonmark spec to reflect some common conventions.shebang
:midgydocuments are programs and may begin with a shebang.front matter
: can be included at the beginning of a document or after a shebang.
: either toml, json or yaml can be useddoctest
: a literate programming convention for including tests in python stringscode
: our code blocks are modified to be aware of doctests and include lexical diagnostics of the contentrendering tokenized CommonMark as Pythonmidgytranslates markdown to python relative to indented code blocks. content between indented code blocks are wrapped a python block strings, and non-indented code blocks can be included in python programs. the translation from markdown to python is meant to require the fewest changes to have valid python code.midgygoes to great lengths to generate a line-for-line translation of the markdown to python.
the line-for-line translation improves the error handling experience when using non-python documents as modules.from sys import argv
  print(argv)
Package: midi
With this API, you can read MIDI files from disk, build new MIDI streams, process, or filter preexisting streams, and write your changes back to disk.  If you install this package on a Linux platform with alsalib, you can take advantage of the ALSA kernel sequencer, which provides low latency scheduling of MIDI events.  SWIG is required to compile the ALSA extension sequencer extension.  Although OSX and Windows provide similar sequencer facilities, this API does not yet support them.
Package: midi2sc
InstallationYou can installmidi2scwitheasy_install:$ easy_install midi2scHowever, you also need to installpkaudioand its dependencies.Usagemidi2scallows you to assign MIDI controllers toSuperColliderSynthDefs.ConfigurationAn example configuration:[SOSkick]
midi_channel = 01
001 = amp_mul=            AbsoluteControl(min=0.0, max=1.27, start_vel=100.0)
106 = mod_freq=           IDC(min=2.0, max=20.0, steps=50, value=2.0)
107 = mod_index=          IDC(min=2.0, max=20.0, steps=50, value=2.0)
108 = beater_noise_level= IDC(min=2.0, max=20.0, steps=50, value=18.0)
109 = decay=              IDC(min=0.05, max=1.0, steps=70, value=0.3)
noteon_args = out=18This configuration will create and assign 7 controls: one of typeAbsoluteControl, four of typeIDC(IncDecControl).  The two
controls implicitly created are aNoteOnControland aNoteOffControl.The001midi controller is usually the modulation wheel.  Here
it’s bound to theamp_mulparameter of anSOSkickSynthDef.minis the value sent to the SuperCollider Synth when the wheel is
at its lowest position,maxthe value at its highest position.The106midi controller is bound to an endless encoder that sends
relative values between01 to 64for increment and127 to 065for decrement.  There’s 50stepsbetween theminandmaxvalue.  And the value at which we start is2.0.  This corresponds
to what the M-Audio Axiom User Guide calls2's Complement from 0 / Relative (2's Complement).There’s also dedicated controls for pitch bend and after touch.SuperColliderThis is how a SynthDef could look like that uses the configuration
from before:SynthDef("SOSkick", {
  arg out = 0, freq = 50, mod_freq = 6.5, mod_index = 19.5,
  decay = 0.1, amp = 0.8, beater_noise_level = 0.001, amp_mul = 1.0;
  var x;

  // do stuff...
  Out.ar(out, x);
});Make sure you have your SuperCollider server up and SynthDefs loaded
before you startmidi2sc.Starting midi2scOn the command-line,midi2scis run like this:$ midi2scThis assumes that you have amidi2sc.iniconfiguration file in the
current working directory.  You can also provide this filename as an
option on the command-line.  Refer to the built-in help for more
options:$ midi2sc --helpmidi2scwill ask you for a MIDI port to bind to, and then it’ll
start a GUI that shows sliders for all controls and finally drop you
into an interactive shell with access to variables like dictionary of
controlhandlersand thesave_presetsandload_presetsfunctions.  To save presets (values from all controllers) from a file
on the Python shell and then load them again later, you write:>>> save_presets('presets1.pickle', midi_in)
>>> # ... time passes
>>> load_presets('presets0.pickle', midi_in)You can also load a newmidi2sc.iniconfiguration:>>> handlers.update(configure.read('midi2sc2.ini'))ScreenshotThe top left window is themidi2scPython shell.  Below is themidi2scGUI with a column of sliders for each synth.  On the right
areQJackCtlconnections andSeq24:Development Statusmidi2scis somewhat mature, and I use it.  At the same time it’s a
big hack and probably not thread-safe.Change Log0.1 - 2009-06-30First release.
Package: midi2Tiles
midi2TilesDemoAboutThis tool create synthesia-like piano tiles effect from midi files.Although Synthesia provides nice animation, it is not for free.
Hence, I use matplotlib to create the piano tiles animation.The output video can futher be imported in video editting software such as After Effects as an overlay of your video.Installpip install midi2TilesUsage# some video settingsVIDEO_DPI=1000VIDEO_FPS=60VIDEO_WIDTH=1080VIDEO_HEIGHT=720# the proportion of keyboard displayKB_RATIO=0.1# speed of the falling tiles (pixels per sec)# notice that this value also affect the height of each tileTILE_VELOCITY=500frommidi2TilesimportpianoTileCreatorptc=pianoTileCreator.PianoTileCreator(video_width=VIDEO_WIDTH,video_height=VIDEO_HEIGHT,video_dpi=VIDEO_DPI,video_fps=VIDEO_FPS,KB_ratio=KB_RATIO,tile_velocity=TILE_VELOCITY,key_color="green",showKeyVelocity=True)ptc.loadMidiFile("<input midi file>",verbose=True)ptc.render("<output video file>",verbose=True)Parametersvideo_width (int): the width of the output video (px)video_height (int): the height of the output video (px)video_dpi (int): the dpi of the output video (px)video_fps (int): the fps of the output video (px)KB_ratio (float): the proportion of the piano keyboard display. This value should be in [0,1)tile_velocity (int): the velocity of the falling tileskey_color (string): the color of the tilesshowKeyVelocity (bool): if True, the velocity of midi notes will affect the opacity of the tilesAuthorIan Shih
Email:yjshih23@gmail.comAcknoledgementThe ratio of the piano design is referenced fromhttps://github.com/gin66/piano_keyboard
Package: midi2voice
Singing Synthesis from MIDI fileThis script relies on thesinsy.jpwebsite from the Nagoya Institute of Technology which implements a HMM-based Singing Voice Synthesis System.You can find a sample merged with the instrumental audiohere.Requirementsmusescore: It's used to convert midi to musicxmlpython 3Installationpipinstallgit+git://github.com/mathigatti/midi2voice.gitUsageYou can use it running the installed module usingpython -m. It has five parameters, the lyrics_file, midi_file, singer sex (optional), tempo (optional) and destination folder (optional).Usage exampleCheck the midi and text sampleshere.# Print helppython3-mmidi2voice-h# Generate the voice given a midi file and a text file with the lyricspython-mmidi2voice-lshallow.txt-mshallow.mid-gfemale-t96Try it on ColabIf you don't have python installed or you just want to check it quickly you can try it onlinehere.CreditsThis source code was developed by Mathias Gatti (@mathigatti) if you use it please remember to cite me. For scientific publications you can use this DOI.Gatti, M. (2020). mathigatti/midi2voice v1.0.0 (v1.0.0) [Computer software]. Zenodo. https://doi.org/10.5281/ZENODO.3969003Support my workIf you want to help me to keep going developing and maintaining open-source projects you can contribute buying me someko-fi.LicenseMIT
Package: midi-abstraction
midi_abstractionAbstract midi pitches into keys, chords, modes, scales, and notes.This, combined with a midi file creation package like 'mido', and maybe a little help from builtin 'random', is all you need to procedurally generate music.Installationpip install midi_abstractionUsage#!/usr/bin/env python3
import midi_abstraction

# create a key object. Note + either major or minor or modename
k = midi_abstraction.Key('d_dorian')

# available list methods
k.list_notes()
k.list_chords()
k.list_notes_in_octave(3)
k.list_notes_in_pentatonic_minor()
k.list_notes_in_pentatonic_major()

# available dict methods
k.chords_in_octave(3)
k.notes_in_pentatonic_minor()
k.notes_in_pentatonic_major()


# attributes
k.name
k.seniority
k.mode
k.chords
k.notes

### functions not tied to a class ###

# get the midi pitches of a specific note
midi_abstraction.notes('a')

# get midi pitch of a specific note in specific cotave
midi_abstraction.notes('cs')[4]

# get a list of all available notes
midi_abstraction.list_notes()

# get a list of major and minor keys (doesn't list modal keys)
midi_abstraction.list_keys()

# get a list of mode names
midi_abstraction.list_modes()

# if you need to iterate through note names and don't want to hit an out of range index, use universe:
midi_abstraction.universe()

# get the midi pitches of notes in a specific chord:
midi_abstraction.chords('c_major')

# you can also invent your own chords like this if you want to get weird.
midi_abstraction.chords('cs_e_ab')


#### examples of how to use ######
# get a random modal key and create an instance of it.
import random
n = random.choice(midi_abstraction.list_notes())
m = random.choice(midi_abstraction.list_keys())
k = midi_abstraction.Key(n + '_' + m)

# get some chords
first = k.list_chords()[0]
second = random.choice(k.list_chords())
third = random.choice(k.list_chords())

# you need mido to write midi files
import mido

# you can use a loop on [first, second, third] to push the pitches into mido tracks.
# See https://github.com/cyberrumor/keygen/blob/main/keygen.py for an example implementation. 
# Good luck!
Package: midi-clip
midi-clipA python package for midi clip (and midi duration) based on mido. (github)Author: Hyun Shin (kyaryunha)IntroduceThis library considers a lot of things for detailing midi clips: followings:Supports both multi-track MIDISupports both tempo track & non-tempo trackConsider set_tempo, time_signature, controllers that appear before start time or note_on that were not closedConsider empty space before the midiAll note_on and note_off pairs are validate. (Number of note_on and note_off is the same, and all note_on are closed by note_off)...Usagepip install midi-clipimportmidoimportmidi_clip# load midi use midomid=mido.MidiFile('resources/hosu.mid')# clip midioutput_mid=midi_clip.midi_clip(mid,5.,15.)# you can get total duration(second) of mididuration=midi_clip.midi_duration(output_mid)# if you see by printprint(output_mid,duration)# if you save midi clipoutput_mid.save('output.mid')ResultResult of clip "A Town With An Ocean View" MIDI from 0 to 30 seconds and from 5 to 15 seconds.0s-30s5s-15sPiano RollAudiohttps://github.com/kyaryunha/midi-clip/blob/main/example/ocean_0_30.wavhttps://github.com/kyaryunha/midi-clip/blob/main/example/ocean_5_15.wav** Used GarageBand to obtain piano roll images and Cubase to obtain audio.
GarageBand and Cubase fill in the measure regardless of the actual end of track time in the MIDI, resulting in slightly longer audio. MIDI file's time clip is precisely.** Data used for result was allowed by an anonymous artist.
Package: midi_const
midi_constPython MIDI constantsThis very simple package provides useful constants derived from official
MIDI specifications available at:MIDI Association, ex MIDI Manufacturers Association (MMA) [US]:https://midi.orgAssociation of Musical Electronics Industry (AMEI) [JP]:https://www.amei.or.jp/MIDI Standard Committee (MSC) [JP]:http://amei.or.jp/midistandardcommitteeStatusAlready covers most of the MIDI 1.0 Detailed Specification v4.2.1 from
February 1996.Other specifications will be added along the way.Contributions welcome!LicenseTo allow maximal re-usability, these constants are offered,
at your option, under any of the following licenses:CC0-1.0MIT (OSI and FSF compatible)UnlicenseInstallationpipinstallmidi_constUsageInteractively:>>>importmidi_constasmidi>>>midi.STATUS_BYTES.get(0x80)'Note Off'>>>midi.CONTROLLER_NUMBERS.get(7)'Channel Volume'>>>midi.SMF_DEFAULT_TEMPO500000.0>>>help(midi)Within a program:frommidi_constimportGENERAL_MIDI_SOUND_SET,GENERAL_MIDI_SOUND_SET_GROUPINGSindex=GENERAL_MIDI_SOUND_SET.index('Banjo')# index = 105group=GENERAL_MIDI_SOUND_SET_GROUPINGS.get(index)# group = 'Ethnic'
Package: midict
MIDictis an ordered “dictionary” with multiple indices
where any index can serve as “keys” or “values”,
capable of assessing multiple values via its powerful indexing syntax,
and suitable as a bidirectional/inverse dict (a drop-in replacement
for dict/OrderedDict in Python 2 & 3).FeaturesMultiple indicesMulti-value indexing syntaxConvenient indexing shortcutsBidirectional/inverse dictCompatible with normal dict in Python 2 & 3Accessing keys via attributesExtended methods for multi-indicesAdditional APIs to handle indicesDuplicate keys/values handlingQuickstartnameuidipjack1192.1tony2192.2The above table-like data set (with multiple columns/indices) can be represented using aMIDict:user=MIDict([['jack',1,'192.1'],# list of items (rows of data)['tony',2,'192.2']],['name','uid','ip'])# a list of index namesAccess a key and get a value or a list of values (similar to a normaldict):user['jack']==[1,'192.1']Any index (column) can be used as the “keys” or “values” via the advanced
“multi-indexing” syntaxd[index_key:key, index_value].
Bothindex_keyandindex_valuecan be a normal index name
or anint(the order the index), andindex_valuecan also be atuple,listorsliceobject to specify multiple values, e.g.:user['name':'jack','uid']==1user['ip':'192.1','name']=='jack'user['name':'jack',('uid','ip')]==[1,'192.1']user[0:'jack',[1,2]]==[1,'192.1']user['name':'jack','uid':]==[1,'192.1']The “multi-indexing” syntax also has convenient shortcuts:user['jack']==[1,'192.1']user[:'192.1']==['jack',1]user['jack',:]==['jack',1,'192.1']AMIDictwith 2 indices can be used as a bidirectional/inverse dict:mi_dict=MIDict(jack=1,tony=2)mi_dict['jack']==1# forward indexing: d[key] -> valuemi_dict[:1]=='jack'# backward/inverse indexing: d[:value] -> keyDocumentationSeehttps://midict.readthedocs.ioInstallationpip install midictPyPI repository:https://pypi.python.org/pypi/midictDevelopmentSource code:https://github.com/ShenggaoZhu/midictReport issues:https://github.com/ShenggaoZhu/midict/issues/newTestingpython tests/tests.pyTested with both Python 2.7 and Python 3,3, 3.4, 3.5.