Saravanan666/pypi-org huggingface dataset:
Package: ormgen
orm_gengenerate sqlalchemy orm class automatically from existing database tableseasy to use and extendsupport column tablesupport composite index, besides composite primary keyUsage:ormgen --help:


usage: ormgen [--help] [-v] [-h HOST] [-u USER] [-p PASSWORD] [-s SCHEMA]
            [-o OUTFILE]

Generates SQLAlchemy model code from an existing database.

optional arguments:
  --help                show help
  -v, --version         show version
  -h HOST, --host HOST  mysql host
  -u USER, --user USER  username
  -p PASSWORD, --password PASSWORD
                      password
  -s SCHEMA, --schema SCHEMA
                      schema
  -o OUTFILE, --outfile OUTFILE
                        file to write output to (default: stdout)
Package: ormgrop
OrmgropDevL's own standard library for Python 3.Collectionsget_inandrequire_inAccess values in nested Python structures that respond to the[]indexing syntax.Inspired by of Elixir'sget_in. If you squint.UsageFor "soft" getting a value, useget_in(collection, path)where path is a list of keys/indices. This function optionally takes adefaultvalue to be returned if the final key/index is not found. By default this isNone.For "hard" getting a value, userequire_in(collection, path)where path is a list of keys/indices. This function raises aNestedValueNotFoundErrorif the final key/index is not found.
Package: ormic
ormicA simple, asynchronous python ORM for SQLite databasesInstallation# stable$pipinstallormic# unstable$pipinstallgit+https://github.com/Dorukyum/ormicQuickstartfromormicimportDatabase,Modeldb=Database()# create a model@db.modelclassPoint(Model):name:strx:inty:int=5# default value# connect to a databaseawaitdb.connect("database.db")Database Actions# create an objectpoint=Point(name="A",x=5,y=10)awaitpoint.save()# fetch objects from the databasepoint_named_A:Point|None=awaitPoint.fetch(name="A")list_of_points_named_A:list[Point]|None=awaitPoint.fetch_all(name="A")# update an objectawaitpoint.update(y=15)# orpoint.y=15awaitpoint.update()# delete an objectawaitpoint.delete()Caching# turn caching on# setting limit to 20 will only cache the last fetched 20 objects# this parameter defaults to None, caching all fetched objectsdatabase.set_caching(on=True,limit=20)# get the object from the cache# will fetch from the database if no matches foundpoint_named_A=awaitPoint.get_or_fetch(name="A")
Package: ormlite
Read The DocsPyPIUsageInstall:pip install ormliteSample code:fromdatetimeimportdatetimefromormliteimportconnect_to_sqlite,migrate,model,field,select,upsert@model('persons')classPerson:email:str=field(pk=True)age:intheight:strlast_seen:datetime=datetime.now()db=connect_to_sqlite("demo.db")migrate(db)upsert(db,[Person('me@me.com',23,"5ft 10in")],update=[])models=select(Person).where("age = '23'").models(db)print(list(models))# Output: [Person(email='me@me.com', age=23, height='5ft 10in', last_seen=datetime.datetime(...))]db.close()MotivationI wanted to query a sqlite database, without writing verbose queries. Previously, for work, I've used django's orm for interacting with sql databases. But for a recent small personal project, I wanted a library to interact with sqlite without depending on an entire web framework.After I deciding to build my own library, I decided to embrace modern python idioms. So my library is built on top of the dataclasses library in the standard lib.To keep scope small, ormlite only interops with sqlite, not other sql databases. I have no future plans to change this.Use caseormlite operates off the principle, that your python source code is the source of truth for the state of the sql tables. Migrations are run in a single step, it checks for differences between your python tables and your sql database. Then it applies sql migrations immediately.Django & Ruby on Rails, have a separate step whereby migrations are serialized to files. Migrations are thus shared across dev machines, and to production this way.Since ormlite doesn't do this, it's not suitable for production deployment or teams of devs.My use case for the library involves running scripts on my local machine, so I enjoy not dealing with the hassle of an evergrowing list of migrations in my repo.
Package: ormm
Operations Research Models & Methods (ORMM) is inspired by Paul A. Jensen’s
Excel Add-ins.  His Excel packages were last updated in 2011, and while I
believe they do still work, his work may become outdated in a couple of ways:Excel is not as commonly used for OR, except in settings where security is
of the utmost concern and/or modern languages like Python, R, Julia, C, C++,
MATLAB, AMPL, or other modeling software are not available.From what I understand, Microsoft has been trying to phase out VBA and move
to Javascript.  If this happens, this could significantly impact whether or
not his packages will work.While his website and packages are still availablehere, some sections are/may
become unusable.  The animations rely on Flash, which is being phased out
in google chrome and other web browsers.This python package aims to accomplish some of the same goals as Paul
Jensen’s website and add-ins did, mainly toBe an educational tool that shows how abstract models (linear programs,
integer programs, nonlinear programs, etc.) can be applied to real-life
scenarios to solve complex problems.Help the practitioner by providing modeling frameworks, methods for solving
these models, and problem classes so a user can more easily see how they
may be able to frame their business problem/objective through the lens of
Operations Research.This repository contains subpackages for grouping the different types of OR
Models & Methods.  Currently this subpackage list includesmathprog: A subpackage for mathematical programs, including linear
programs and mixed integer linear programs.markov: A subpackage for discrete state markov analysis.network: A subpackage for network models and methods, including the
transportation and shortest path tree problems.
Package: orm-mysql
MySql ORMA simple Object Relational Mapper for MySql. Works with existing tables and the schema of the tables are automatically inferred.Installpipinstallorm-mysqlConnect to MySqlfromormimportTableTable.connect(config_dict={'host':'<host_here>','port':3306,'user':'<user>','password':'<password>','database':'<database>'})Create a class for a tableCreate a class that inherits fromTable. Initialize the class variabletable_namewith the name of the table, here 'student'fromormimportTableTable.connect(config_dict=CONFIG)classStudent(Table):table_name='student'OR useget_table()fromormimportTable,get_tableTable.connect(config_dict=CONFIG)Student=get_table('student')Insert dataUsingsave()new_student=Student(name='hrushi',age=19,gender='M')new_student.age=20new_student.save()Usingcreate()new_student=Student.create(name='hrushi',age=19,gender='M')Query dataUsingwhere()students=Student.where(age=19,gender='F')forstuinstudents:print(stu.name)Usingfind()Find a single record based on PRIMARY KEY.# find student where id(PK) = 2student=Student.find(2)print(student.name)Delete a recordstudent=Student.find(2)student.destroy()Relationshas_manyandbelongs_tocan be used to show relationships between tables.fromormimportTable,has_many,belongs_toclassArticle(Table):table_name='articles'relations=[belongs_to(name='author',_class='Author',foreign_key='author_id',primary_key='id')]classAuthor(Table):table_name='authors'relations=[has_many(name='articles',_class='Article',foreign_key='author_id')]Get all the books written a Authorauth=Author.find(2)articles=auth.articles()forartinarticles:print(art.title)Get Author of a bookart=Article.find(5)author=art.author()print(author.name)
Package: or-models
or_models (Operations Research Models)Mathematical Optimization Models and AlgorithmsHow to InstallYou can use pip to install the code:> pip install or_modelsModels Included:Set Covering Problem:Create an SCP object>>> costs = np.array([2,3,4,5])
>>> matrix = np.array([[1,0,1,0],
                       [1,0,0,1],
                       [0,1,1,1]])
>>> scp = SCP(costs,matrix)Solve with a MIP model created using Google OR-tools>>> scp.solve_with_GOR()Solve using Lagrange Relaxation method with some modification as discussed inBeasley, John E. "A lagrangian heuristic for set‐covering problems." Naval Research Logistics (NRL) 37.1 (1990): 151-164.>>> output = scp.LR_method(scp.row_least_cost,numIterations=1000)
>>> print(output)
(5, {0: 1, 1: 1})Dependenciesgoogle or-toolsnumpytime
Package: orm.py
orm.py========A small ORM for Python.Features--------- Basic queries (select, insert, update, order by, limit, offset)- Simple model interace with foreign keysNot Features------------- Database or table creation, modification, or migration- Joins, full text search, most other database featuresRequirements------------- python3- postgresql- psycopg2To do------ python2 support- better comparison support- only update fields that have changed- order by with `get`- query unique entries- tests- improve query interface- expand sql functionalityExample===Tables are not created for you, so you must create them yourself.Table names should match the class name when converted to underscore-separated words, so a class UserRelationship will map to the table"user\_relationship".Tables must have a serial primary key called "id", and foreign keyfields must be appended with "\_id".import orm''' You should first set up tables named "user" and "message" '''class User(orm.Model):username = orm.Field()password = orm.Field()def get_all_received_messages(self):''' You could also pass in a limit and offset, or yield resultsone at a time.'''return list(Message.all(user_to=self, order_by='-date_sent'))def get_all_sent_messages(self):return list(Message.all(user_from=user, order_by='-date_sent'))class Message(orm.Model):user_from = orm.ForeignKey(User) # field should be named "user_from_id"user_to = orm.ForeignKey(User) # field should be named "user_to_id"date_sent = orm.Field()body = orm.Field()read = orm.Field(default=False)Now you can make queries in a script or interpreter:u = User.get(id=1)m = list(Message.all(user_from=u))API---user.save()Saves or updates a Model object.user.delete()Deletes the Model object. Any cascades must be done in table definitions.Model.get(id=None, **kwargs)Pass in the ID or kwargs matching your model fields.Model.all(separator='AND', order_by=None, limit='ALL', offset=None, **kwargs):`all` yields the results, so you must catch them in a loop or list.- separator: pass in 'OR' and a kwarg with a list of possible arguments. For example:Message.all(separator='OR', user_from=[user_1, user_2])This will match all messages from either user\_1 or user\_2.- order\_by: pass in a string with a field name. Prepend '-' to reverse the order.- limit: Limit results to first n results.- offset: Integer to offset your search result- kwargs: each kwarg value can be a single object or a list.Model.count(**kwargs)Returns an integer.Model.is_unique(**kwargs)Returns True or False.
Package: ormspace
ormspaceORM modules powered by Pydantic for Deta Space.InstructionsThe packageormspacewill use the deta data key provides asCOLLECTION_KEYor will look forDETA_PROJECT_KEYif the
first is not provided. This way you can set a custom data key or use the project default. The sistem cannot work all is
missing.the 'modelmap' decoratorTo include the class in the system mapping you must use the 'modelmap' decorator.  With this procedure you will get:access to deta space api for read and write your datacreate special fields for each class:Model.KeyModel.KeyListExampleimport datetime
import asyncio
from ormspace import model as md

@md.modelmap
class Person(md.Model):
    first_name: str 
    last_name: str 
    birth_date: datetime.date

@md.modelmap
class Patient(md.Model):
    person_key: Person.Key


async def main():
    await Patient.update_references_context()
    for item in await Patient.sorted_instances_list():
        print(item)

asyncio.run(main())
Package: ormstorm
Welcome to ORMStormORMStorm is a small library for easy work with databases.The key features are:Simplicity:The library is very simple, and it won't take long to learn it.Coding speed:Integrating the library into your projects won't take long.Dynamic:Unlike others, this library will allow you to very quickly create new tables and add databases to them.Installingpip install ormstormUsageUsing standard tablesfromormstormimportTable,Types,Column,create_sessionclassExampleTable(Table):__tablename__="example"id=Column(Types.INTEGER,primary_key=True,autoincrement=True)text=Column(Types.STRING)LocalSession=create_session("example.sqlite3",[ExampleTable])withLocalSession()assession:session.insert(ExampleTable(text="Hello, world!"))Using a dynamic tablefromormstormimportDynamicTable,Types,Column,create_sessionLocalSession=create_session("example.sqlite3",[])withLocalSession()assession:NewTable=DynamicTable("new_table",{"id":Column(Types.INTEGER,primary_key=True,autoincrement=True),"text":Column(Types.STRING)})session.create(NewTable)session.insert(NewTable(text="Easy use of dynamic tables!"))Magic filtersMagic filters is a special system that allows you to quickly write conditions for sql queries in the usual python style!
Magic filters currently support the following operators:=,!=,>=,>,<=,<,&,|,~Simple use of magic filters:fromormstormimportTable,Types,Column,create_sessionclassExampleTable(Table):__tablename__="example"id=Column(Types.INTEGER,primary_key=True,autoincrement=True)text=Column(Types.STRING)LocalSession=create_session("example.sqlite3",[ExampleTable])withLocalSession()assession:result=session.select((ExampleTable.text=="Hello")|((ExampleTable.id>5)&(ExampleTable.id<15)))Instead of the usualandandor,&and|are used, respectively. Also,~is used instead of theorkeyword.
It is also worth noting that some expressions should be wrapped in parentheses to avoid unexpected errors.To select all data from a table, simply specify its class.result=session.select(ExampleTable)DocumentationAt the moment, all documentation is located in the library itself. Each function and class has good documentation to understand what the function is for.NoteThis library is strictly not recommended for use in large projects because of the small functionality!
Package: orngpenguen
This is a password generator that is created with a hash code philosophy. Inside the library, the hash_generator() takes 2 arguments. The first one is the password you want to hash and the other one is the key for more security. Key can be simple numbers or short texts. This library is in development. If you manage to write any decoder or find anything nonsense to you feel free to send an email to me.Change Log0.0.1 (30/09/2021)-First Release
Package: oro
📦 setup.py (for humans)This repo exists to providean example setup.pyfile, that can be used
to bootstrap your next Python project. It includes some advanced
patterns and best practices forsetup.py, as well as some
commented–out nice–to–haves.For example, thissetup.pyprovides a$ python setup.py uploadcommand, which creates auniversal wheel(andsdist) and uploads
your package toPyPiusingTwine, without the need for an annoyingsetup.cfgfile. It also creates/uploads a new git tag, automatically.In short,setup.pyfiles can be daunting to approach, when first
starting out — even Guido has been heard saying, "everyone cargo cults
thems". It's true — so, I want this repo to be the best place to
copy–paste from :)Check out the example!Installationcdyour_project# Download the setup.py file:#  download with wgetwgethttps://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.py-Osetup.py#  download with curlcurl-Ohttps://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.pyTo DoTests via$ setup.py test(if it's concise).Pull requests are encouraged!More ResourcesWhat is setup.py?on Stack OverflowOfficial Python Packaging User GuideThe Hitchhiker's Guide to PackagingCookiecutter template for a Python packageLicenseThis is free and unencumbered software released into the public domain.Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.
Package: oroboros
Oroborosis an astrology software written in Python.
It is based on the following modules:AstroDienst’s Swiss Ephemeris (pyswisseph) version >= 1.74.00-0Olson timezones (pytz)Qt toolkit (PyQt4) version >= 4.3Optionally:Docutilsversion = 0.5Mercurial(for distant charts repositories)Supybot(for IRC plugin)What’s new?Usual bug fixesAdditional asteroids: Eris, Sedna, Quaoar, Nessus, VarunaFeaturesCharts: natal/radix, transits, progression, harmonics, profectionOpen Astrolog or Skylendar charts tooSave charts as images in various formats (png, jpg, bmp, svg,…)Query the onlineGeoNames.orgatlas databaseCalculates all planets, nodesMore than 300 fixed starsAsteroids (Eris, Quaoar, Sedna, etc)Uses Swiss, JPL, or Moshier EphemerisA flexible and powerfull configuration systemGeocentric, topocentric, heliocentric or barycentric chartsVarious house systems, including Gauquelin sectorsTropical or sidereal zodiacsMidpoints calculations and drawingsFormat comments withDocutilsreStructured TextSynchronize your charts with a distant repository (usingMercurial)A few toys for IRC chat addicts (Supybotplugin)And easy extension capabilities with the Python language…Oroboros manualInstallationDownload and install the package and the required modules (most of them
are available in your distro repositories). For example, uncompress the latest
source package ofOroboroswithtar jxforoboros-xxxxxxxx.tar.bz2, thencdoroboros-xxxxxxxx, finally (with super-user permission) typepython setup.py install.Ephemeris filesYou should also install the compressed ephemeris data files on your system
(/usr/local/share/swissephlooks like a good idea). These files are freely
distributed onAstroDienst public FTP server.A simple installation would require that you download the following files,
allowing calculations over the period from 1800 to 2399:sepl_18.se1semo_18.se1seas_18.se1fixstars.catseorbel.txtYou can also grab the following asteroids files (other asteroids can be
implemented on demand):136199 Eris7066 Nessus50000 Quaoar90377 Sedna20000 Varuna128 NemesisUsageIf everything goes well you will be able to start the application by typingoroborosin your shell.First stepsUpdate the configuration settings, especially the path to ephemeris files.
You may also create an aspects filter and an orbs filter for the midpoints
settings, otherwise you’ll have some surprises.Download
Package: orodha-user-client
orodha-user-sdkDescriptionThe Orodha User SDK is a Software Development Kit used in
order to interact with the Orodha User Service.UsageIn order to use the SDK you need to have an environment variable that contains the base url for the running user service. This variable is namedORODHA_USER_SERVICE_BASE_URLTo use the SDK you must import the client class from the orodha_user_client module, like so:from orodha_user_client import OrodhaUserClientAfter importing the module, you simply instantiate the client with a special credentials object which you can create usingorodha-keycloak.The credentials object is calledOrodhaCredentialsand is an object containing the information needed to communicate with keycloak via orodha-keycloak.MethodsThe only available method currently is thebulk_getmethod.
This method will return a list of objects with the following structure:{
    "_id": str,
    "keycloak_id": str,
    "username": str,
}It accepts a dictionary called request_args that contains the arguments for the request to the Orodha User Service.The expected shape of the dictionary is as so:{
    "pageSize": int,
    "pageNum": int,
    "targets": list[str]
}Thetargetslist is used to query only for specific usernames and their values; if the targets list is empty, the query will be for all users in the database.A dictionary is required to be passed into the function, but the dictionary need not contain any values; this is because the user service contains default values for this call.
Package: orographic_precipitation
APythonframework that implements the Linear Theory of Orographic Precipitation
followingSmith & Barstad (2004).The model includes airflow dynamics, condensed water advection, and downslope
evaporation. It consists of two vertically-integrated steady-state advection
equations describing: (i) the cloud water density and (ii) the hydrometeor
density. Solving these equations using Fourier transform techniques,
derives a single formula relating terrain and precipitation.Please refer to the original manuscript of Smith and Barstad (2004) to understand
the model physics and limitations.InstallationRequired dependencies:Python 3.6 or laternumpyorographic_precipitation can be installed usingpip:$ pip install orographic_precipitationAlternatively, you can install orographic_precipitation fromconda-forge:$ conda install orographic_precipitation -c conda-forgeUsageImport relevant functions to compute orographic precipitation,
set up a topography and plot the resulting precipitation matrix.importmatplotlib.pyplotaspltfromorographic_precipitationimportcompute_orographic_precip2. Create example topography, for instance, an isolated circular Gaussian hill
(see original publication, Fig. 4 a-c).defgauss_topography(dx,dy):"""Returns synthetic topography for testing.
  Analogous to Fig 4 in Smith and Barstedt, 2004.
  """h_max=500.x0=-25e3y0=0sigma_x=sigma_y=15e3x,y=np.arange(-100e3,200e3,dx),np.arange(-150e3,150e3,dy)X,Y=np.meshgrid(x,y)h=(h_max*np.exp(-(((X-x0)**2/(2*sigma_x**2))+((Y-y0)**2/(2*sigma_y**2)))))returnX,Y,hdefplot2d(X,Y,field):"""Function that plots precipitation matrices"""fig,ax=plt.subplots(figsize=(6,6))pc=ax.pcolormesh(X,Y,field)ax.set_aspect(1)fig.colorbar(pc)dx=750.dy=750.X,Y,elevation=gauss_topography(dx,dy)plot2d(X,Y,elevation)Initialize dictionary with relevant parameters, compute and plot orographic
precipitation.lapse_rate=-5.8lapse_rate_m=-6.5ref_density=7.4e-3param={'latitude':40,'precip_base':7,# uniform precipitation rate'wind_speed':10,'wind_dir':270,# wind direction (270: west)'conv_time':1000,# conversion time'fall_time':1000,# fallout time'nm':0.005,# moist stability frequency'hw':5000,# water vapor scale height'cw':ref_density*lapse_rate_m/lapse_rate# uplift sensitivity}P=compute_orographic_precip(elevation,dx,dy,**param)plot2d(X,Y,P)AcknowledgementThis project is supported by theEarth Surface Process Modellinggroup at
the German Geoscience Research Institute in Potsdam, Germany.