Saravanan666/pypi-org huggingface dataset:
Package: casbin-mongoengine-adapter
mongoengine Adapter for PyCasbinmongoengine Adapter is themongoengineadapter forPyCasbin. With this library, Casbin can load policy from mongoengine supported database or save policy to it.Based onOfficially Supported Databases, The current supported databases are:mongodbInstallationpip install casbin_mongoengine_adapterSimple Exampleimportcasbin_mongoengine_adapterimportcasbinadapter=Adapter(dbname='casbin_test',host='mongodb://localhost:27017')e=casbin.Enforcer('path/to/model.conf',adapter,True)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1casbin_mongoengine_adapterpasselse:# deny the request, show an errorpassGetting HelpPyCasbinLicenseThis project is licensed under theApache 2.0 license.
Package: casbin_motor_adapter
Motor Adapter for PyCasbinMotoradapter forPyCasbin.With this library, Casbin can load policy from MongoDB or save policy to it.ExampleMotor support a coroutine-based API for non-blocking access to MongoDB.So that, this adapter allows you to use pycasbin'sAsyncEnforcer.load_policy()load_policy()loads all policies from storage.importcasbin_motor_adapterimportcasbinadapter=casbin_motor_adapter.Adapter('mongodb://localhost:27017/',"dbname")e=casbin.AsyncEnforcer('path/to/model.conf',adapter,True)awaite.load_policy()sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1passelse:# deny the request, show an errorpassload_filtered_policy()load_filtered_policy()loads filtered policies from storage. This is useful for performance optimization.Policy Subset Loading,https://casbin.org/docs/policy-subset-loadingAdditionally,load_filtered_policy()supports the MongoDB native queries for filtering conditions.importcasbin_motor_adapterimportcasbinadapter=casbin_motor_adapter.Adapter('mongodb://localhost:27017/',"dbname")e=casbin.AsyncEnforcer('path/to/model.conf',adapter,True)# define filter conditionsfilter=Filter()filter.ptype=["p"]filter.v0=["alice"]# support MongoDB native queryfilter.raw_query={"ptype":"p","v0":{"$in":["alice"]}}# In this case, load only policies with sub value aliceawaite.load_filtered_policy(filter)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1passelse:# deny the request, show an errorpassAcknowledgmentsThis adapter was inspired bypymongo-adapter.LicenseApache 2.0 license.
Package: casbin-peewee-adapter
Peewee Adapter for PyCasbinPeewee Adapter is thePeeweeadapter forPyCasbin. With this library, Casbin can load policy from Peewee supported database or save policy to it.Based onOfficially Supported Databases, The current supported databases are:PostgreSQLMySQLSQLiteInstallationpip install casbin_peewee_adapterSimple Exampleimportcasbin_peewee_adapterimportcasbinimportpeeweeDATABAEE=peewee.SqliteDatabase('db.sqlite3')adapter=casbin_peewee_adapter.Adapter(database=DATABAEE)e=casbin.Enforcer('path/to/model.conf',adapter,True)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1casbin_peewee_adapterpasselse:# deny the request, show an errorpassGetting HelpPyCasbinLicenseThis project is licensed under theApache 2.0 license.
Package: casbin-pony-adapter
Pony ORM Adapter for PyCasbinSQLAlchemy Adapter is thePony ORMadapter forPyCasbin. With this library, Casbin can load a policy from Pony ORM supported databases or save a policy to it.Based onOfficially Supported Databases, The current supported databases are:PostgreSQLMySQLSQLiteOracleCockroachDBInstallationpip install casbin_pony_adapterSimple Exampleimportcasbin_pony_adapterimportcasbinfrompony.ormimportDatabaseadapter=casbin_pony_adapter.Adapter(Database('sqlite',':memory:'))e=casbin.Enforcer('path/to/model.conf',adapter)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1casbin_sqlalchemy_adapterpasselse:# deny the request, show an errorpassGetting HelpPyCasbinLicenseThis project is licensed under theMIT license.
Package: casbin-postgresql-watcher
postgresql-watcherCasbin role watcher to be used for monitoring updates to casbin policiesInstallationpipinstallcasbin-postgresql-watcherBasic Usage ExampleWith Flask-authzfromflask_authzimportCasbinEnforcerfrompostgresql_watcherimportPostgresqlWatcherfromflaskimportFlaskfromcasbin.persist.adaptersimportFileAdaptercasbin_enforcer=CasbinEnforcer(app,adapter)watcher=PostgresqlWatcher(host=HOST,port=PORT,user=USER,password=PASSWORD,dbname=DBNAME)watcher.set_update_callback(casbin_enforcer.e.load_policy)casbin_enforcer.set_watcher(watcher)Basic Usage Example With SSL EnabledSeePostgresQL documentationfor full details of SSL parameters.With Flask-authzfromflask_authzimportCasbinEnforcerfrompostgresql_watcherimportPostgresqlWatcherfromflaskimportFlaskfromcasbin.persist.adaptersimportFileAdaptercasbin_enforcer=CasbinEnforcer(app,adapter)watcher=PostgresqlWatcher(host=HOST,port=PORT,user=USER,password=PASSWORD,dbname=DBNAME,sslmode="verify_full",sslcert=SSLCERT,sslrootcert=SSLROOTCERT,sslkey=SSLKEY)watcher.set_update_callback(casbin_enforcer.e.load_policy)casbin_enforcer.set_watcher(watcher)
Package: casbin-pymongo-adapter
PyMongo Adapter for PyCasbinPyMongo Adapter is thePyMongoadapter forPyCasbin. With this library, Casbin can load policy from MongoDB or save policy to it.Installationpip install casbin_pymongo_adapterSimple Exampleimportcasbin_pymongo_adapterimportcasbinadapter=casbin_pymongo_adapter.Adapter('mongodb://localhost:27017/',"dbname")e=casbin.Enforcer('path/to/model.conf',adapter,True)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1casbin_sqlalchemy_adapterpasselse:# deny the request, show an errorpassGetting HelpPyCasbinLicenseThis project is licensed under theApache 2.0 license.
Package: casbin-rabbitmq-watcher
rabbitmq-watcherRabbitmq Watcher is the rabbitmq watcher for pycasbin. With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.Installationpipinstallcasbin-rabbitmq-watcherSimple Exampleimportosimportcasbinfromcasbin_rabbitmq_watcherimportnew_watcherdefget_examples(path):examples_path=os.path.split(os.path.realpath(__file__))[0]+"/../examples/"returnos.path.abspath(examples_path+path)defupdate_callback_func(msg):...watcher=new_watcher()watcher.set_update_callback(update_callback_func)e=casbin.Enforcer(get_examples("rbac_model.conf"),get_examples("rbac_policy.csv"))e.set_watcher(watcher)# update_callback_func will be callede.save_policy()Getting HelpCasbinLicenseThis project is under Apache 2.0 License. See theLICENSEfile for the full license text.
Package: casbin-redis-adapter
Redis Adapter for PyCasbinRedis Adapter is theredisadapter forPyCasbin. With this
library, Casbin can load policy from redis or save policy to it.Installationpip install casbin_redis_adapterSimple Exampleimportcasbin_redis_adapterimportcasbinadapter=casbin_redis_adapter.Adapter('localhost',6379)e=casbin.Enforcer('path/to/model.conf',adapter,True)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1casbin_sqlalchemy_adapterpasselse:# deny the request, show an errorpassConfigurationAdapter()enable decode_responses by default and supports any Redis parameter configuration.To use casbin_redis_adapter, you must provide the following parameter configurationhost: address of the redis serviceport: redis service portThe following parameters are provided by defaultdb: redis database, default is0username: redis username, default isNonepassword: redis password, default isNonekey: casbin rule to store key, default iscasbin_rulesFor more parameters, please followredis-pyGetting HelpPyCasbinLicenseThis project is licensed under theApache 2.0 license.
Package: casbin-redis-watcher
redis-watcherredis-watcher is theRediswatcher forpycasbin. With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.Installationpip install casbin-redis-watcherSimple Exampleimportosimportcasbinfromcasbin_redis_watcherimportnew_watcher,WatcherOptionsdefcallback_function(event):print("update for remove filtered policy callback, event:{}".format(event))defget_examples(path):examples_path=os.path.split(os.path.realpath(__file__))[0]+"/../examples/"returnos.path.abspath(examples_path+path)if__name__=="main":test_option=WatcherOptions()test_option.host="localhost"test_option.port="6379"test_option.channel="test"test_option.ssl=Falsetest_option.optional_update_callback=callback_functionw=new_watcher(test_option)e=casbin.Enforcer(get_examples("rbac_model.conf"),get_examples("rbac_policy.csv"))e.set_watcher(w)# then the callback function will be called when the policy is updated.e.save_policy()Getting HelppycasbinLicenseThis project is under Apache 2.0 License. See theLICENSEfile for the full license text.
Package: casbin-sqlalchemy-adapter
SQLAlchemy Adapter for PyCasbinSQLAlchemy Adapter is theSQLAlchemyadapter forPyCasbin. With this library, Casbin can load policy from SQLAlchemy supported database or save policy to it.Based onOfficially Supported Databases, The current supported databases are:PostgreSQLMySQLSQLiteOracleMicrosoft SQL ServerFirebirdSybaseInstallationpip install casbin_sqlalchemy_adapterSimple Exampleimportcasbin_sqlalchemy_adapterimportcasbinadapter=casbin_sqlalchemy_adapter.Adapter('sqlite:///test.db')e=casbin.Enforcer('path/to/model.conf',adapter)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1passelse:# deny the request, show an errorpassGetting HelpPyCasbinLicenseThis project is licensed under theApache 2.0 license.
Package: casbin-sqlobject-adapter
SQLObject Adapter for PyCasbinSQLObject Adapter is theSQLObjectadapter forPyCasbin. With this library, Casbin can load policy from SQLObject supported database or save policy to it.The current supported databases are:PostgreSQLMySQLSQLiteMicrosoft SQL ServerFirebirdSybaseMAX DBpyfirebirdsqlInstallationpip install casbin_sqlobject_adapterSimple Exampleimportcasbin_sqlobject_adapterimportcasbinadapter=casbin_sqlobject_adapter.Adapter('sqlite:///test.db')e=casbin.Enforcer('path/to/model.conf',adapter,True)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1casbin_sqlalchemy_adapterpasselse:# deny the request, show an errorpassGetting HelpPyCasbinLicenseThis project is licensed under theApache 2.0 license.
Package: casbin-tortoise-adapter
Tortoise ORM Adapter for PyCasbinThis is an asynchronous adapter forpycasbinusing Tortoise ORM.Supports Python 3.7+.Installationpython3-mpipinstall--usercasbin-tortoise-adapter# or via your favorite dependency manager, like PDMThe current supported databases arelimited by Tortoise ORM.DocumentationThe only configurable is the underlying Model used byTortoiseAdapter. While simple, it should be plenty to cover most use cases that one could come across. You can change the model by passing themodelclass: CasbinRulekeyword argument to the adapter and updating the model in your Tortoise ORM init configuration.Themodelclassvalue must inherit fromcasbin_tortoise_adapter.CasbinRuleto ensure that all the expected fields are present. ATypeErrorwill throw if this is not the case.A custom Model, combined with advanced configuration like show in the Tortoise ORM"Two Databases" example, allow you to change where your authorization rules are stored (database, model name, etc.)Basic examplefromcasbinimportAsyncEnforcerfromtortoiseimportTortoisefromcasbin_tortoise_adapterimportCasbinRule,TortoiseAdapterasyncdefmain()# connect to db and generate schemasawaitTortoise.init(db_url="postgres://postgres:password@test-db:5432/my_app",modules={"models":["casbin_tortoise_adapter"]},)awaitTortoise.generate_schemas()adapter=casbin_tortoise_adapter.TortoiseAdapter()e=AsyncEnforcer('path/to/model.conf',adapter)sub="alice"# the user that wants to access a resource.obj="data1"# the resource that is going to be accessed.act="read"# the operation that the user performs on the resource.ife.enforce(sub,obj,act):# permit alice to read data1passelse:# deny the request, show an errorpassLicenseThis project, like other adapters, is licensed under theApache 2.0 License.This package isTreeware. If you use it in production, then we ask that youbuy the world a treeto thank us for our work. By contributing to my forest you’ll be creating employment for local families and restoring wildlife habitats.
Package: cascabel
Cascabel es un proyecto con el propósito de agilizar la creación de páginas web mediante el uso del framework Flask y sus librerias asociadas (Flask SqlAlchemyyFlask WTF).Listado de comandos:Comando extendidoAbreviación--help-h--verify_libraries-vl--new_project-np--make_controller-mc--make_crud_controller-mcc--make_model-mm--make_request-mrUso de comandos:Para el uso de los comandos se pueden realizar de las siguientes maneras:🪟 Windows:C:\Users\User\Desktop>cascabel...
C:\Users\User\Desktop>python-mcascabel...🐧 Linux:xxxxx@xxxxx:~$python-mcascabel...🍎 MacOS:xxxxx@xxxxx~%python-mcascabel...Estructura de comandos:Crear un nuevo proyecto:# Ubiquémonos en la carpeta donde quieras crear el proyecto.C:\Users\User\Desktop>cascabel--new_projectproject_nameEjecutar proyecto:# Ubiquémonos en la carpeta del proyecto.C:\Users\User\Desktop\project_name>pythonexecute.pyCrear controlador:# Ubiquémonos en la carpeta del proyecto.C:\Users\User\Desktop\project_name>cascabel--make_controllerproject_nameCrear controlador CRUD:# Ubiquémonos en la carpeta del proyecto.C:\Users\User\Desktop\project_name>cascabel--make_crud_controllerproject_nameCrear modelo:# Ubiquémonos en la carpeta del proyecto.C:\Users\User\Desktop\project_name>cascabel--make_modelproject_nameCrear Request:# Ubiquémonos en la carpeta del proyecto.C:\Users\User\Desktop\project_name>cascabel--make_requestproject_nameConsultar comandoscascabel--help⚠️Cascabelse encuentra actualmente en fase de desarrollo, lo que podría resultar en la incompatibilidad entre las plantillas de las versiones futuras y las actuales.
Package: cascade-config
cascade-configCascading Python configuration from the CLI and multiple config files.cascade-config simplifies handling multiple configuration sources, such as config files, command line arguments, or even simple dictionaries. Configuration sources can be added
one-by-one and will be parsed in hierarchical order, with each new source updating the
existing configuration.InstallationInstall with pippip install cascade-configQuickstartMultiple configuration sources can be added to acascade_config.CascadeConfigobject. When parsed, each configuration will be added in hierarchical order and update
the existing configuration. The result is a single dictionary containing the cascaded
configuration.fromcascade_configimportCascadeConfig# Setup CascadeConfig instance with JSON schema for validationcascade_conf=CascadeConfig(validation_schema="config_schema.json")# Add default and user configurations in cascading ordercascade_conf.add_json("config_default.json")cascade_conf.add_json("config_user.json")# Parse the configuration files into a dictionaryconfig=cascade_conf.parse()SeeUsagefor more
information and examples.ContributingBugs, questions or suggestions? Feel free to post an issue in theissue trackeror to make a pull
request! SeeContributingfor more info.ChangelogSeeChangelog.
Package: cascadenik
Cascadenik==========Cascadenik implements cascading stylesheets for Mapnik.It’s an abstraction layer and preprocessor that converts special, CSS-likesyntax into Mapnik-compatible style definitions. It’s easier to write complexstyle rules using the alternative syntax, because it allows for separation ofsymbolizers and provides a mechanism for inheritance.Cascadenik supports many of Mapnik’s features in a simple declarative form:/* Define a few colors */@black: #000;@orange: #f90;/* Start with a white background */Map{map-bgcolor: #fff;}/* Draw roads as orange lines */#roads{/* Usually, 3px wide */line-width: 3;line-color: @orange;/* Make the important ones wider */&[kind=major] { line-width: 4 }&[kind=highway] { line-width: 5 }/* Add the road names in black */name{text-placement: line;text-face-name: "DejaVu Sans Book";text-fill: @black;text-size: 12;}}See more examples at https://github.com/mapnik/Cascadenik/wiki/Examples.Usage-----See `INSTALL.md` for installation instructions.See the `doc/` folder for more usage examples.Unroll the rules in example.mss and show their cascade order:% cascadenik-style.py example.mss > example-ordered-unrolled.mssCompile `example.mml` into a Mapnik-suitable XML file:% cascadenik-compile.py example.mml example-compiled.xmlRender a MML file directly to an image using nik2img.py:% nik2img.py example.mml example.png
Package: cascadetoml
IntroductionCommand for cascading toml "databases" into their full objectsTOML cascades are file trees that define generic configuration. Cascading allows
for shared setting to be set in one place.The root of a cascade has two files that define it:.cascade.tomldefines settings forcascadetoml. Settings are:pathsa list of strings where each string is a python format-style string. These strings are used to pull out setting defined by the path.<type>.template.tomldefines the full structure of the resulting TOML object.<type>is used as the name for the array of tables output when a cascade results in multiple objects. The keys in the table are the only ones allowed in TOML files within the tree. The types of values must also be consistent.Settings for a particular folder are in a TOML file with the folder name plus the.tomlextension.The first repo using this is thenvm.tomlrepo. Its only path is{technology}/{manufacturer}/{sku}.toml. A file such asflash/gigadevice/GD1.tomlwill have the implicit values:technology="flash"manufacturer="gigadevice"sku="GD1"All of the other values come from these files in order:flash/flash.tomlflash/gigadevice/gigadevice.tomlflash/gigadevice/GD1.tomlNo key may exist at multiple levels.cascadetoml checkcan be used to validate much of this.Installing from PyPITo install for current user:pip3installcascadetomlTo install system-wide (this may be required in some cases):sudopip3installcascadetomlTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-name
python3-mvenv.envsource.env/bin/activate
pip3installcascadetomlInstalling for developmentcascadetomlusesflitfor packaging. To install a development copy into your current venv do:flit install -s --deps developAfter install, you simply edit the files in place and the venv will use the source files directly.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.DocumentationFor information on building library documentation, please check outthis guide.
Package: cascadict
See full documentation onReadTheDocs.History0.8.4 (2015-11-16)Fixed pip build problem.0.8.3 (2015-11-16)Fixed import bug in Python 3.x. (#1) Thanks@nicodemus26.Added tox testing for Python 2.7, 3.4. (#2) Again, thanks@nicodemus26.0.8.2 (2015-09-08)First release on PyPI.
Package: cascajal
Cascajalis a script which automates generating PDFs fromHieroglyphpresentations usingFirefox.How It WorksHieroglyphgenerates HTML presentations fromRestructured Textdocuments. Sometimes, however, you need a PDF. For the conference
organizer,Speaker Deck, etc.Cascajalautomates generating
that PDF using Firefox.InstallingYou can install Cascajal usingpip:$ pip install --user cascajalNote that you’ll need to have the user binary directory on your PATH;
seepip 2014if you need help with that.Cascajal doesn’t have any external Python dependencies. It does depend
on Firefox (orIceweasel, or something Firefox-like).Generating PDFsAfter you’ve installed Cascajal, you can generate a PDF of your
slides.$ make slides # this runs Hieroglyph; see the Hieroglyph docs
$ cascajal -o slides.pdf ./_build/slides/index.htmlCascajal will create a temporary Firefox profile, launch the browser,
and print to a PDF. After printing completes, you can close the
browser, or Cascajal will do it for you after a few seconds.You’ll get something likehttps://speakerdeck.com/nyergler/in-depth-pdbas output.Wait, but…My slides aren’t rendering correctly!!What theme are you using? Cascajal works best with theslides2theme in Hieroglyph.slidesandsingle-levelboth have some
known issues; your mileage may vary.How does Cascajal find Firefox on my system?Poorly.Right now it looks in a couple of common places where it might be
installed on Linux. At some point I’ll add common places for Mac
OS X. I’d love it if someone using Windows helped make detection
work there.Why Firefox?Of the tools I tried, Firefox came the closest to working “out of
the box”. Cascajal just tries to smooth over all the settings
(documented and otherwise) that you need to set to make it work.What notPhantomJS?Phantom currently does not support web fonts. So while it does anamazingjob of generating in a headless fashion, even simple
things like monospace fonts render incorrectly.PhantomJS 2 is currently under development, and should include
improved support for web fonts. It’s not hard to imagine a Cascajal
of the future that uses Phantom, and works even better.How can I help?Try it out, let me know what doesn’t work!SeeHACKING.rstfor information on how to edit the code.What’s up with the name?According to Wikipedia,TheCascajal Blockis a tablet-sized writing slab made of serpentinite
from Mexico which has been dated to the early first millennium BCE,
incised with hitherto unknown characters that may represent the
earliest writing system in the New World.So Cascajal is a writing slab for your Hieroglyphs.News0.1Release date: UNRELEASED