Saravanan666/pypi-org huggingface dataset:
Package: objecttools
Various tools for working with objects and classes in PythonCached propertiesWorks just like a normal property, but returned values are cached:fromobjecttoolsimportCachedPropertyclassExpensiveOperations(object):@CachedPropertydefexpensive_attribute(self):returnself.calculate()# To make it settable@expensive_attribute.setterdefexpensive_attribute(self,value):pass# To make it deletable@expensive_attribute.deleterdefexpensive_attribute(self):passe=ExpensiveOperations()e.other_attribute=1print(e.expensive_attribute)# Takes a long time.print(e.expensive_attribute)# Very quick; just retrieve from cachev=e.expensive_attributee.other_attribute=2# expensive_attribute should be different now!print(e.expensive_attribute)# Old value that is wrong.dele.expensive_attributeprint(e.expensive_attribute)# Takes a long time, but returns new value.e.other_attribute=1# Reset to known valuee.expensive_attribute=vprint(e.expensive_attribute)# Correct value!SingletonsfromobjecttoolsimportSingletonSentinel=Singleton.create('Sentinel')Sentinel()isSentinel()# Trued.get('missing_value',Sentinel())isSentinel()# TrueclassGlobalState(dict,metaclass=Singleton):attr=0gs=GlobalState()gs['value']=7gs.attr=1print(GlobalState()['value']+GlobalState().attr)# 8For Python 2 and 3 compatibility, use it as a decorator:@Singleton.as_decoratorclassClass(object):passObjectProxyCreate a weak-referenceable proxy to an object that supports the same
operations:fromobjecttoolsimportObjectProxyls=[1,2,3]proxy=ObjectProxy(ls)proxy.append(4)proxy+=[5,6]proxy[2:4]=[7,8,9]print(ls)# [1, 2, 7, 8, 9, 5, 6]serializableCreate serializable forms of objects (For pickling)fromobjecttoolsimportSerializableFunction,SerializableConstantimportpicklefile=open('file.txt','w')f=lambdafile,a:file.write(a)try:# Cannot pickle files, even though it is a global constantgile=pickle.loads(pickle.dumps(file))exceptTypeError:gile=pickle.loads(pickle.dumps(SerializableConstant('file',__name__))).valuetry:# Cannot pickle functions if they are lambdas# Or are inner functions# Or are deleted after creation# Or are methodsg=pickle.loads(pickle.dumps(f))exceptpickle.PicklingError:g=pickle.loads(pickle.dumps(SerializableFunction(f)))g(gile,'data')# WorksInstallingFromPyPI$pipinstallobjecttoolsFrom source$gitclone'https://github.com/MitalAshok/objecttools.git'$python./objecttools/setup.pyinstall
Package: object-to-xfile
Object_to_xFileUnder construction! Not ready for use yet! Currently experimenting and planning!Developed by Sachin Indoriya (c) 2022Examples of How To Use (Buggy Alpha Version)fromobject_to_xfile.xconvertorimportXConverterdummy_data={['name':'John','age':23,'hobby':'reading'],['name':'Tom','age':23,'hobby':'coding']}# create XConvertor objectx_convertor_obj=XConverter(dummy_data)# for csv, call to_csv() methodsx_convertor_obj.to_csv()# for html, call to_html() methodsx_convertor_obj.to_html()# for excel, call to_excel() methodsx_convertor_obj.to_excel()# for pdf, call to_pdf() methodsx_convertor_obj.to_pdf()# for xml, call to_xml() methodsx_convertor_obj.to_xml()
Package: object-trace
Trace every use of selected objects.Installpip install object-traceExample resultGiven the followingscriptfrom object_trace import trace, print_traces

def producer_of_X(cache):
    cache["X"] = trace(42.42, "X")

def inscrutable_user_of_X(cache):
    cache["Y"] = cache["X"] + 1
    cache["X"] = 15.1

with print_traces():
    d = {}
    producer_of_X(d)
    inscrutable_user_of_X(d)
    print(d["X"])runningpython3.9 example.pyprints:# Trace for label=`X`
_   : call `<module>`                   | 
  [/mnt/c/Users/alexv/repos/object_trace/example.py:1]
  15  : call `producer_of_X`              | producer_of_X(d)
    [/mnt/c/Users/alexv/repos/object_trace/example.py:4]
    5   : use                               | cache["X"] = trace(42.42, "X")
    5   : Ref count 6->3                    | cache["X"] = trace(42.42, "X")
  16  : call `inscrutable_user_of_X`      | inscrutable_user_of_X(d)
    [/mnt/c/Users/alexv/repos/object_trace/example.py:8]
    9   : use                               | cache["Y"] = cache["X"] + 1
    10  : Ref count 3->2                    | cache["X"] = 15.1
--------------------------------------------------------------------------------
Package: object-tracker
object-trackerA pure python object change and history tracker. Monitor all changes in your objects lifecycle and trigger callback functions to capture them.View theGithub repositoryand theofficial docs.$pipinstallobject-trackerTested for python 3.6, 3.7 and above.Key FeaturesDetermine if a python object has changed.Investigate change history through the changelog.Trigger callback functions whenever the object or an attribute has changed.Simple and structured API.Queryable change history log.LicenseCopyright (c) Saurabh Pujari
All rights reserved.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.Usage :fromobject_trackerimportObjectTrackerdefobserver(attr,old,new):print(f"Observer :{attr}->{old}-{new}")classUser(ObjectTracker):def__init__(self,name)->None:ObjectTracker.__init__(self,observers=[observer,])self.name=nameuser=User("A")print(user.tracker.changed())# Falseuser.name="B"# observers will be triggered# Observer : name -> A - Bprint(user.tracker.changed())# True
Package: objectutils
objectutilsInstallationpipinstallobjectutilsAboutTiny functions that extend python json-like objects functionality as highly customizable:traversingtransformingflatteningsumdiffoperations on json-like python objects(lists, dicts)Allows writing comprehensions without comprehensions 🙃Only python 3.10+ supportedProvided as python library and made to be used from python directly.Inspired by:jmespathjqExamplesHaving the following response from some API:obj={"computers":[{"computername":"1","software":["s1","s2"],},{"computername":"2","software":["s2","s3"],},{"computername":"3","software":["s1","s3"],},]}traverseYou should write something like that to get theCounterof the software installed in total:fromitertoolsimportchainc=Counter(chain.from_iterable([computer["software"]forcomputerinobj["computers"]]))Such expressions getting even worse in more complicated cases.
Withtraversemethod provided by this tiny lib you should do the following to get the sameCounter:fromobjectutilsimporttraversec=traverse(obj,[Counter,chain.from_iterable,"computers",[],"software"])traversesupports callable objects in its path, as well as the keys of object.[]considered as all the possible values in iterable, as 'asterisk'(*).If applicable, calls the funcs and callable objects with unpacked iterable from the right. On exception that was predicted in this case, tries to call with single argumentAs for me, it is much clearer approach than writing comprehensions or loops in such cases.TransformationIt is also possible to transform the data selected by traverse using dicts on the path, but this may be a bit tricky:traverse({"old1":{"old2":"old3"},"old4":"old5"},[{"new2":[]},[{"new3":["old1","old2"],"new4":["old4"]},{"anothernew4":["old4"]}]])#Result {'new2': [{'new3': 'old3', 'new4': 'old5'}, {'anothernew4': 'old5'}]}flattenfromobjectutilsimportflattenUseflatten(obj)to get a flat dictionary in form{path: plain value}For the data above, the result is the following:{("computers",0,"computername"):"1",("computers",0,"software",0):"s1",("computers",0,"software",1):"s2",("computers",1,"computername"):"2",("computers",1,"software",0):"s2",("computers",1,"software",1):"s3",("computers",2,"computername"):"3",("computers",2,"software",0):"s1",("computers",2,"software",1):"s3",}zip_dictsUsed to join values of two similar dicts on same paths. May be used to find a diff betweens two dicts, join values as a sumfromobjectutilsimportzip_dictsd1={1:{2:3,3:3,}}d2={1:{2:4,3:3,}}zip_dicts(d1,d2,lambdaa,b:a+b,lambdaa,b:a==b)# {1: {3: 6}} - "find a sum on all same paths where values are equal"Third argument is a function for two items on the same paths, fourth is the filter for leaf dict values.Using as diff (default mapping and filter)d1={1:{3:3,4:2,}}d2={1:{3:3,4:3,}}zip_dicts(d1,d2)# {1: {4: (2, 3)}} - elements on path [1, 4] not equal(2 and 3 correspondingly)The keys are the paths that may be used intraverseto get the value next to them. However intended usage is to reduce the path somehow, using".".join()or something like that
Package: objectwalker
A python module to explore the object tree to extract paths to interesting objects in memory.FeaturesPython module to use in pdb after abreakpoint().Standalone tool to explore paths in python modules.Multiple built-in filters.Possibility to implement custom filters and pass them to ObjectWalker().InstallationYou can now install it from pypi with this command:sudo python3 -m pip install objectwalkerExample commandsWe want to find all the paths to theosmodule in the modulejinja2:objectwalker -m jinja2 --filter-object-is-module os --max-depth 15ContributingPull requests are welcome. Feel free to open an issue if you want to add other features.
Package: obj-encrypt
obj_encryptChinese Versionobj-encrypt is an encryption library based on the 'AES-256-GCM' algorithm. It uses Python objects as the basic unit and it can convert objects into binary 'ciphertext' and support decryption. Objects encrypted with obj-encrypt support TCP communication, database storage, and more.InstallationRecommended Environment: Python 3+Enter the command window, create a virtual environment, and enter the following commands in turnLinux and macOS:python3-mvenvvenv# Create a virtual environment..venv/bin/activate# Activate the virtual environment.Windows:python-mvenvvenv# Create a virtual environment.venv\Scripts\activate# Activate the virtual environment.Install obj-encrypt, enter in turnpipinstall--upgradepippipinstallobj-encryptUsefrom obj_encrypt import Secret


def main():
    # Initialize the secret instance, the key is an AES-256 key, and the maximum size cannot exceed 32 strings.
    secret = Secret(key='0123456789')
    # build the data dictionary
    data = {
        'author': 'Cyberbolt',
        'personal_website': 'https://www.cyberlight.xyz/',
        'time': '2022-02-10'
    }
    ciphertext = secret.encrypt(data) # Convert the object to binary ciphertext and get the ciphertext.
    print(ciphertext, ' ', type(ciphertext))
    plaintext = secret.decrypt(ciphertext) # Decrypt ciphertext as object.
    print(plaintext)


if __name__ == '__main__':
    main()Outputb'U2FsdGVkX18IANYgINODlF8BjkxI3AaKJ/+10Iexgh65qyEKFY21HK5LSjiTuy37arjYAuIQQls+amqCdEdVdy0V1E6xECJXOFBb0kfIzQuxOimOaFFVvtq4IntjJNdCHLiTwuExVfwAW7CjqaD554B71IoT0o9xqrFch3N0vtq+UP0uXyMmMCsvu8zY7vrCuw9qM+kOW2VWsC2c2ePDnofvakchgDW9bGF8fTC3prE+TPksoJ4l6ERCjjRid54gP6+HmzB+TwOVSGaj+4VIdm1g7qv591tBU1U6Lxm83Hk='   <class 'bytes'>
{'author': 'Cyberbolt', 'personal_website': 'https://www.cyberlight.xyz/', 'time': '2022-02-10'}You can encrypt your own objects in addition to Python dictionaries, and the encrypted binary can be stored in a database or used for TCP communication.If this module was helpful to you, I hope to receive your GitHub Star! Thank you so much!GitHubCyberLight
Package: objerve
objerveA tiny observer for the attributes of Python objects.Installationobjervecan be installed by runningpip install objerveExample UsageLet's say you have a class like that;classM:qux="blue"def__init__(self):self.bar=55self.foo=89self.baz=121To watch the changes, you need the add the@watch()as a class decorator. Within the
arguments of thewatchdecorator you should pass in lists for the keyword arguments of
the attributes you wish to watch.fromobjerveimportwatch@watch(set={"foo","qux"},get={"bar","foo"},delete={"baz"})classM:qux="blue"def__init__(self):self.bar=55self.foo=89self.baz=121m=M()m.bar=233defabc():m.foo+=10m.qux="red"defget_foo(m):m.barabc()m.foodelm.bazget_foo(m)Output:Set|foo=89File"/home/blue/objerve/examples/example.py",line9,in__init__self.foo=89Set|qux=redFile"/home/blue/objerve/examples/example.py",line21,in<module>m.qux="red"Get|fooFile"/home/blue/objerve/examples/example.py",line18,inabcm.foo+=10Set|foo=99File"/home/blue/objerve/examples/example.py",line18,inabcm.foo+=10Get|fooFile"/home/blue/objerve/examples/example.py",line29,in<module>m.foo

Delete|bazFile"/home/blue/objerve/examples/example.py",line30,in<module>delm.baz

Get|barFile"/home/blue/objerve/examples/example.py",line25,inget_foom.bar
Package: objetive
ObjetiveThis library is a mini-crawler that aims to grab some text parts from some website or ip that responds http*UtilityThis tool can be used in others projects that depend of specifics informations.Exampleimportobjetiveprint(objetive.listed('https://jul10l1r4.github.io'))# ["Ipsum"...]print(objetive.text('https://jul10l1r4.github.io'))# "Ipsum..."Installpip3installobjetive--userFilosofyThis software follow the filosofiy KISS (Keep it simple, stupid!) and belive in simplicity.
We are free software and respect the you privacity :stuck_out_tongue_closed_eyes:
Package: objexplore
Objexplore is an interactive Python object explorer for the terminal. Use it while debugging, or exploring a new library, or whatever!https://user-images.githubusercontent.com/13981456/134781043-a2d2b375-12b6-4400-8b54-b59720b2f8b8.movInstallpip install objexploreorpip install git+https://github.com/kylepollina/objexploreUsagefromobjexploreimportexploreimportrichexplore(rich)FeaturesType filtersSearch filtersStack viewExploring and returningOpen the source file in$EDITORPress?in the app to view more features.Type Filtershttps://user-images.githubusercontent.com/13981456/134781148-7068ff86-ba6f-4996-9a98-d7dc3adcdf54.movSearch Filtershttps://user-images.githubusercontent.com/13981456/134781262-b8e38485-3346-4d81-bfd0-4ea318001ed8.movStack viewhttps://user-images.githubusercontent.com/13981456/134781375-f630647d-6fc2-4d13-9ba9-92b9f397e103.movExploring and returninghttps://user-images.githubusercontent.com/13981456/133946981-3bf5cfda-6eac-4514-abb3-e073dd3fb6b2.movOpen source file in$EDITORhttps://user-images.githubusercontent.com/13981456/134768632-1d3d22a8-7554-4085-b25b-94fee2528df4.movBuilt with the amazingrichandblessedpackages. Check them out!ContributingReadCONTRIBUTING.mdLICENSE
Package: objfreeze
Short descriptionFunction converts recursively an object of standard (im-)mutable types into
strictly immutable ones.Long descriptionIn Python sometimes it is useful to have a “static” struct to be shared across
functions and classes and to guarantee it can not be changed accidentally
by some code.In addition to standard immutable simple types (like int, str etc.), there are
two complex types:frozensetandtuple. Unfortunately years ago (2012-02)
there was PEP-0416[1] where afrozendictwas rejected as hard to be
implemented.Unlike other wrappers implementation here works similar to acopy.deepcopyfunction which immediately copies mutable objects into immutable analogues
instead of wrapping them at access time. Therefore if a code passes already
immutable object, there is almost no overhead, but the code do not need to pay
attention whether to deepcopy of incoming (or outgoing) data or not.[1]https://www.python.org/dev/peps/pep-0416/
Package: objfromconfig
python-objfromconfigCreate objects from config dataFree software: Apache Software License 2.0Documentation:https://objfromconfig.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2021-05-14)First release on PyPI.
Package: objifier
OBJECT CLASSIFIERClone this repositoryfor SSHgit clone git@github.com:1chimaruGin/Object-classifier.gitfor httpshttps://github.com/1chimaruGin/Object-classifier.gitRequirementspip install -U requirements.txtDatasetthe dataset directory should be the following format.# for example, dog vs cat classification
data/
    -train/
        dog/
            -*.jpg or *.png
        cat/
            -*.jpg or *.png
    -val/
        dog/
            -*.jpg or *.png
        cat/
            -*.jpg or *.pngUsage with Argparsecd Object-classifier/objifierUpdate number of classes and names in data.yamlFor training model(ResNet)$ python main.py -m [mode: train] -opt [optimizer: (default='SGD')]  -epochs [epochs: (default=25)]For training model(EfficientNet)$ python main.py -m [mode: train] -opt [optimizer]  -epochs [epochs] -backbone [backbone: efficientNet] -lvl [efficientNet level]For prediction$ python main.py -m [mode: predict] -im [input image] - backbone [backbone: ResNet or efficientNe] -lvl [efficientNet level]Usage with YAML (via pip)Create a YAML file as sample below:For training [train.yaml]nc: 10
# names: ['mantled_howler', 'patas_monkey', 'bald_uakari', 'japanese_macaque', 'pygmy_marmoset', 
#       'white_headed_capuchin', 'silvery_marmoset', 'common_squirrel_monkey', 'black_headed_night_monkey','nilgiri_langur' ]

names: ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']

backbone: 'efficientNet'

efftlvl: 0

optimizer: 'Adam'

mode: 'train'

epoch: 2

load: False

output: 'output'

dataset_path: nullFor prediction [predict.yaml]nc: 10
# names: ['mantled_howler', 'patas_monkey', 'bald_uakari', 'japanese_macaque', 'pygmy_marmoset', 
#       'white_headed_capuchin', 'silvery_marmoset', 'common_squirrel_monkey', 'black_headed_night_monkey','nilgiri_langur' ]

names: ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']

backbone: 'efficientNet'

efftlvl: 0

output: 'output'

image: 'baobao.jpg'
Package: objinspect
objinspectView the structure of Python classes and functions.InstallationFrom PyPipip install objinspectFrom sourcepip install git+https://github.com/zigai/objinspectExample>>>importmath>>>fromobjinspectimportinspect>>>inspect(math.pow)Function(name='pow',parameters=2,description='Return x**y (x to the power of y).')>>>inspect(math.pow).dict[{"default":"<class""inspect._empty"">","description":"None","kind":"<_ParameterKind.POSITIONAL_ONLY":0>,"name":"x","type":"<class""inspect._empty"">"},{"default":"<class""inspect._empty"">","description":"None","kind":"<_ParameterKind.POSITIONAL_ONLY":0>,"name":"y","type":"<class""inspect._empty"">"}]>>>inspect(inspect)Function(name="inspect",parameters=2,description="The inspect function  takes an object and an optional include_inherited flag (defaults to True) and returns either a Function object or a Class object depending on the type of object.",)LicenseMIT License
Package: obj.mpp
IllustrationLooking for disk-like objects (other shapes available) centered in the green region-of-interest:Image source:К562_(Light_microscopy)Creative Commons Attribution-Share Alike 4.0 International(https://creativecommons.org/licenses/by-sa/4.0/deed.en)InstallationTheObj.MPPproject is published on thePython Package Index (PyPI)at:https://pypi.org/project/obj.mpp. It requires version 3.8, or newer, of the interpreter. It should be installable from Python distribution platforms or Integrated Development Environments (IDEs). Otherwise, it can be installed from a command-line console:For all users, after acquiring administrative rights:First installation:pip install obj.mppInstallation update:pip install--upgradeobj.mppFor the current user (no administrative rights required):First installation:pip install--userobj.mppInstallation update:pip install--user--upgradeobj.mppDocumentationThe Obj.MPP documentation is hosted atedebreuv.gitlabpages.inria.fr/Obj.MPP.ContributionsThe optional, periodic detection refinement step is not part of the original Marked Point Process object detection method (see the Gamal Eldinet alreference in the documentation). It is an heuristic addition. While using Obj.MPP on images containing many objects with this refinement step on, Xavier Descombes noticed that, after some iterations, each iteration was taking very long to complete. He hypothesized that the refinement step was applied in each iteration instead of happening with the specified period. He was right since I had forgotten to reset the refinement-related counter after application.Some features of Obj.MPP were added upon request:Florence Besse and Fabienne de Graeve requested the possibility to ignore some image segments in the computation of an object quality. Note that this can also be done by writing a dedicated quality function, although it requires coding skills of course.Xavier Descombes requested the possibility to combine the object quality with the object area in order to favor a larger, encompassing object over smaller adjacent objects, or not. Note that this can also be done by writing a dedicated quality function, although it requires coding skills of course.ThanksThe project is developed withPyCharm Community.The development relies on several open-source packages (seeinstall_requiresinsetup.py).The code is formatted byBlack,The Uncompromising Code Formatter.The imports are ordered byisort…your imports, so you don’t have to.The HTML documentation is generated bySPHINX,Python Documentation Generator.The package requirement list is generated bypigar.
Package: objmpp-classification
Install packagepipinstallobjmpp-classificationPyPI link :https://pypi.org/project/objmpp-classificationRun packageRun in Python scriptfromobjmpp_classificationimportorganoid_classificationorganoid_classification.organoid_classification(path_data,path_images)Run with command lineobjmpp-classificationorganoid/home/path_data/home/path_imagesShow options:objmpp-classification--helpInstall for developmentIf you want to develop on the package, this will update the package locally automatically when the files changes:pipinstall-e.
Package: objname
objnameA library with a base class that stores the assigned name of an object.>>>importobjname>>>x,y=objname.AutoName()>>>x.name'x'>>>y.name'y'Official documentation at readthedocs:https://objname.readthedocs.io/en/latest/Table Of ContentsRequirementsInstallationTutorialObservationsHow it worksMultiple assignment syntaxAPI referenceclass AutoName()ContributeDonationLicenseRequirementsobjnamerequires Python 3.6 or newer. It has no third-party dependencies and
works on both POSIX and Windows. It runs in cPython and PyPy.InstallationTo install it just usepip:$pipinstallobjnameYou can also install it fromgithub:$pipinstallgit+https://github.com/AlanCristhian/objname.gitTutorialobjnamehas only one class:AutoName. It creates an object with theobjnameattribute that stores the name of such object. E.g:>>>importobjname>>>a=objname.AutoName()>>>a.name'a'It can make multiple variables with iterable unpacking syntax.>>>importobjname>>>x,y=objname.AutoName()>>>x.name'x'>>>y.name'y'You can make your own subclass that inherit fromobjname.AutoName.>>>importobjname>>>classNumber(objname.AutoName):...def__init__(self,value):...super().__init__()...self.value=value...>>>a=Number(1)>>>a.name'a'>>>a.value1ObservationsHow it worksAutoNamesearches the name of the object in the bytecode of the frame where
the object was created. If it can't find a name, then the default'<nameless>'value are set.Multiple assignment syntaxAutoNamestores the last name in the expression.>>>importobjname>>>a=b=objname.AutoName()>>>a.name'b'>>>b.name'b'That is the same behaviour of__set_name__method.>>>classSetName:...def__set_name__(self,owner,name):...self.name=name...>>>classMyClass:...a=b=SetName()...>>>MyClass.a.name'b'>>>MyClass.b.name'b'API referenceclass AutoName()Stores the assigned name of an object in thenameattribute.Single assignment:>>>obj=AutoName()>>>obj.name'obj'Iterable unpacking syntax:>>>a,b=AutoName()>>>a.name'a'>>>b.name'b'ContributeIssue Tracker:https://github.com/AlanCristhian/objname/issuesSource Code:https://github.com/AlanCristhian/objnameDonationBuy Me a Coffee 🙂:https://www.paypal.com/donate?hosted_button_id=KFJYZEVQVRQDELicenseThe project is licensed under the MIT license.