Saravanan666/pypi-org huggingface dataset:
Package: mdb-fields-cleaner
MongoDB fields CleanerIt simplifies the process of cleaning up old deprecated fields in a MongoDB database.This will help you to easily remove obsolete/unused fields in your MongoDB collections so that you can save space in your DB.How to use itIt is as simple asgetting a pymongo.MongoClientand pass it to the Cleaner constructor.Once we have the Cleaner object instance, we just need to call the clean method with the collection name and the field names we want to keep (unset), the fields not in this collection will be removed. This call will return anUpdateResult object.frommdb_fields_cleanerimportCleanerclient=MongoClient()cleaner=Cleaner(client)results:UpdateResult=cleaner.clean(collection.name,["make","model"])print(f"{results.modified_count}modified documents")Data modelsYou can use following convenience cleaners to just remove any field in a collection that is not defined in the model.dataclassesfrompydanticimportBaseModelfrommdb_fields_cleaner.dataclassimportDataClassCleanerfromdataclassesimportdataclass@dataclassclassUser:id:intname:strcleaner=DataClassCleaner(MongoClient())results:UpdateResult=cleaner.clean_fields_not_in_model("users_collection",User)print(f"{results.modified_count}modified documents")Pydantic ModelsfrompydanticimportBaseModelfrommdb_fields_cleaner.pydanticimportPydanticCleanerclassUser(BaseModel):id:intname:strcleaner=PydanticCleaner(MongoClient())results:UpdateResult=cleaner.clean_fields_not_in_model("users_collection",User)print(f"{results.modified_count}modified documents")Development flowCreate a branch and a pull request.Label the pull request with the correct semver label: patch, minor, major.Get the PR approved and merged.At this point the package should be published in Pypi.org registry.
Package: mdbl
Hivatalos MDBL API wrapper Pythonhoz!Példaimportmdblimportdiscordfromdiscord.extimportcommandsimportasyncioclassMDBLAPI(commands.Cog):def__init__(self,bot):self.bot=botself.mdbl=mdbl.MDBL()@commands.command()asyncdeflink(self,ctx):mdbl_link=self.mdbl.botlink(bot.user.id)awaitctx.send(mdbl_link)defsetup(bot):bot.add_cog(MDBLAPI(bot))
Package: mdblog
mdblogmarkdown blog serverview demodemoinstallpip3installmdblogusagemdblogrun# run with config filemdblogrun--config./config.tomlnextstage1支持多用户，每个用户一个博客分支，每一个分支对应着一个github仓库周期检测仓库变化,并同步到本地周期检测本地仓库变化，并编译更新静态页面文件修改博客阅读页面，加入网站导航以及用户博客目录stage2 完整博客系统使用自己的数据库存储博客，提供管理编辑修改界面支持从Github仓库导入，以及导出为压缩包支持评论、点赞功能支持全站搜索和用户内容搜索stage3 转变为内容社区实现推荐系统实现问答功能实现关注、收藏功能实现聊天功能stage4 进化为知识平台、学习平台...
Package: mdbom
Markdown SBOMTransform Software Bill Of Materials (SBOM) to Markdown.RequirementsMdBOM requires Python 3.8 or above.DocumentationThedocumentationis hosted on GitHub Pages.InstallationWithpip:pipinstallmdbomWithpipx:python-mpipinstall--userpipx

pipxinstall--pythonpython3.8mdbomDevelopmentYou needTask.Setup your development environment:tasksetup
Package: mdb-parser
MDBParserEasy use Python library to read Microsoft Access (.mdb, .accdb) database files, this library use the mdb-tools command.InstallingUse pip:pip install mdb-parserOr install manually:git clone https://github.com/fedestella263/mdb_parser
cd mdb_parser
python3 setup.py installUsage Examplefrom mdb_parser import MDBParser, MDBTable

db = MDBParser(file_path="db.accdb")

# Get and print the database tables
print(db.tables)

# Get a table from the DB.
table = db.get_table("MY_TABLE_NAME")

# Or you can use the MDBTable class.
table = MDBTable(file_path="db.accdb", table="MY_TABLE_NAME")

# Get and print the table columns.
print(table.columns)

# Iterate the table rows.
for row in table:
    print(row)
Package: mdbpg
mdbpqHandle both Postgres and MongoDB queries in an interchangable manner.pip install mdbpgimport mdbpg

# create an instance for Postgres or MongoDB through mdbpg
# max_conns and use_env_vars are both optional parameters
# max_conns defaults to 10 and use_env_vars defaults to True
# if use_env_vars is False then mdbpg will try to load a toml
# config named 'database.toml' using mtoml instead
pgdb = mdbpg.postgres(max_conns=5, use_env_vars=True)
mdb = mdbpg.mongodb(max_conns=50, use_env_vars=True)

# both methods work in the same manner, you specify the
# table/collection with the first parameter and then pass
# a dict containing the parameters and values you want
# the function then returns either None if something went
# wrong or a list of dict results
result_list = pgdb.find('dogs', { 'color': 'black' })
result_list = mdb.find('dogs', { 'color': 'black' })
# the benefit of this is that you can build queries in the
# same manner for both databases and expect it to just work

# again these are equivalent, though there are differences
# between how Postgres and MongoDB will view these calls
# for MongoDB this is the entire object, where as with Postgres
# this may only be a few columns and so when setting up your
# table in Postgres it would be ideal to set default values
pgdb.insert('dogs', { 'breed': 'pitbull', 'color': 'white', 'cuteness': 9000.01 })
mdb.insert('dogs', { 'breed': 'pitbull', 'color': 'white', 'cuteness': 9000.01 })
# both Postgres and MongoDB contain the same methods:
# find, insert, update, delete
# though postgres.insert() is the only method with a gotcha like that

# Postgres has two additional methods which handle SQL queries
# both methods can be used to run any valid SQL query except that
# postgres.fetch() expects a result to be returned from the query
# where as postgres.commit() does not
result_list = pgdb.fetch("SELECT * FROM 'dogs' WHERE breed = 'hound'")
pgdb.commit("DELETE FROM 'dogs' WHERE breed = 'hound'")
Package: mdbridge
mdbridgemarkdown extension for writing bridge article, a fast way to write qualified articles from existing xinrui url and bbo lin url<pre lang="bridge">
http://www.xinruibridge.com/deallog/DealLog.html?bidlog=P;1N,P,3N,P;P,P&playlog=W:6H,TH,KH,5H;E:9H,AH,3H,JH;S:TD,8D,2D,6D;S:KD,QH,5D,3D;S:7D,4C,JD,4D;N:QD,9D,2C,8S;N:AD,3S,5S,6S;N:KC,6C,3C,8C;N:2S,4S,KS,AS;W:8H,9C,2H,5C;W:7H,TS,9S,7C;W:4H,TC,7S,JS;W:JC,QS,QC,AC;&deal=9743.K92.9643.Q6%20KJ5.A5.KT7.A7532%20A86.Q87643.8.J84%20QT2.JT.AQJ52.KT9&vul=None&dealer=E&contract=3N&declarer=S&wintrick=8&score=-50&str=%E5%9B%A2%E4%BD%93%E8%B5%9B%20%E7%AC%AC10%E8%BD%AE%20%E7%89%8C%E5%8F%B7%
https://www.bridgebase.com/myhands/fetchlin.php?id=765880487&when_played=1610464081
deal
auction
</pre>Key features (beta release)support xinrui url, bbo lin url (bbo soon)generate well tuned latex/html bridge layout (card diagram)generate all kinds of ebook (.pdf/.mobi/.epub/.html/.latex) with related toolchains (pandoc,multimarkdown)SamplesRamsey's article for xinrui bridge (Chinese), seeramsey.mdandramsey.pdfHow to use itGenerally, follow below stepswrite it in special format with markdownusemdbridgetool to generate intermediate markdown fileusemultimarkdownorpandocto generate related format filesgenerate final ebookSee below# sample.md
<pre lang="bridge">
http://www.xinruibridge.com/deallog/DealLog.html?bidlog=P;1N,P,3N,P;P,P&playlog=W:6H,TH,KH,5H;E:9H,AH,3H,JH;S:TD,8D,2D,6D;S:KD,QH,5D,3D;S:7D,4C,JD,4D;N:QD,9D,2C,8S;N:AD,3S,5S,6S;N:KC,6C,3C,8C;N:2S,4S,KS,AS;W:8H,9C,2H,5C;W:7H,TS,9S,7C;W:4H,TC,7S,JS;W:JC,QS,QC,AC;&deal=9743.K92.9643.Q6%20KJ5.A5.KT7.A7532%20A86.Q87643.8.J84%20QT2.JT.AQJ52.KT9&vul=None&dealer=E&contract=3N&declarer=S&wintrick=8&score=-50&str=%E5%9B%A2%E4%BD%93%E8%B5%9B%20%E7%AC%AC10%E8%BD%AE%20%E7%89%8C%E5%8F%B7%2014/16&dealid=794018966&pbnid=221536004
deal|cards=NS|ul="<str>"|ll=<str>|ur=<str>`
</pre>
$ pip install mdbridge
$ mdbridge2latex sample.md
sample.bridge-tex is created
$ multimarkdown -t latex meta.txt sample.bridge-tex -o sample.tex
$ xelatex article.tex # article.tex is not released yetThe complete guideline will be released soon.markdown formatdefine the deal from url firsthttp://www.xinruibridge.com/deallog/DealLog.html?bidlog=P,2N,P%3B3C,P,3N,P%3B6N,P,P,P%3B&playlog=E:KD,3D,4D,JD%3BE:2D,5D,7D,AD%3BN:JS,6S,5S,8S%3BN:KS,4S,7S,2S%3BN:3S,TS,AS,8H%3BS:QS,TD,4C,9S%3BS:KH,JH,4H,2H%3BS:AH,TH,9H,3H%3BS:QH,9D,8C,5H%3BS:2C,JC,QC,6C%3BN:KC,9C,6D,5C%3BN:AC,7H,6H,3C%3BN:7C,QD,8D,TC%3B&deal=82.JT8.T974.JT53%20KJ3.94.AJ.AKQ874%20T964.7532.KQ2.96%20AQ75.AKQ6.8653.2&vul=All&dealer=W&contract=6N&declarer=N&wintrick=11&score=-100&str=%E7%BE%A4%E7%BB%84IMP%E8%B5%9B%2020201209%20%E7%89%8C%E5%8F%B7%204/8&dealid=995050099&pbnid=345464272
auctioncustomize the dealdeal|cards=NS|ul="<str>"|ll=<str>|ur=<str>Two-Hand Diagramdeal|cards=NSAll-Hands DiagramdealPartial dealdeal=.xxxx..xxx&.T4.A.AK87&-&.AKQ6.865.Partial deal with extra informationdeal=.xxxx..xxx&.94.A.AK87&-&.AKQ6.865.|ll="NS 4/12&EW 0"|ur="match 4/8"CollaboratorRamsey @ xinrui : mainly for latex template and tune the card diagramsReferencehttp://www.rpbridge.net/7z69.htm
Package: mdbtools
# mdbtoolsPython and UNIX CLI utilities to simplify common MongoDB DevOps tasksMichael S. Noblemnoble@broadinstitute.orgThere are a number of common operations one would like to perform uponMongoDB databases directly from a UNIX command line, for scalability,repeatability and automation (e.g. cron jobs).  This package makes it veryeasy to do that, without having to write or think in Javascript OR sacrificingchoice of what key bindings you may edit with.  The package also offers asimple object framework, which not only maintains a consistent look and feelamongst all tools, but also makes it very straightforward to add new ones.To better resonate with the UNIX environment, many utilities in the mdbtoolssuite have been given names which reflect UNIX tools of similar purpose.  Thesuite currently includes:* mdbcat     _display contents of one or more collections, as JSON or TSV/CSV tables_* mdbcp      _copy a collection_* mdbindex   _add/remove indexes to/from a collection_* mdbload    _load a table into a DB_* mdbls      _list the collections in a DB_* mdbmv      _rename (move) a collection_* mdbquery   _issue general purpose key=value queries (with timing info and more, e.g. to assess indexes)_* mdbrm      _remove a collection_* mdbtouch   _create a new, empty collection_* mdbstats   _display summary statistics for one or more collections in a DB_Some of these tools can be extended in a natural way to operate upon entire databases or server instances, not just collections; this has been considered and may appear in a future release.
Package: mdc
This is thought to be an easy to use, import and go, library for Mapped Diagnostic Context style logging.Logs should include all necessary fields collected by the python logging library.
Helper methods are provided to add context fields where required.NOTE1.2.0: recent changes will result in changed json output if using theMDCHandlerclass:>>>withMDC(foobar="baz"):...logging.warning("test"){"message":"test","foobar":"baz"}this is a temporary solution to avoid breaking existing APIs. Please excuse any issues this might cause. In the future output handling should be done on the client side to avoid any possible breakage. The MDCHandler class will eventually be removed.InstallationPyPi:$pipinstall--usermdcFrom source:$pipinstall--user.UsageAdd a handler to the root logger or set the base handler withlogging.basicConfig:>>>importlogging>>>frommdcimportMDCHandler>>># use the MDCHandler only>>>logging.basicConfig(level=logging.DEBUG,handlers=[MDCHandler()])>>># the MDC contextmanager>>>withMDC(foo='bar'):...logging.warning('foobar'){...,"mdc":{"foo":"bar"},"extra":{},...}>>># the with_mdc decorator>>>@with_mdc(test='123')...deffoobar(ctx):...logging.warning('some warning')>>>foobar(){...,"mdc":{"test":"123"},"extra":{},...}>>># logging with extra fields>>>logging.error('some error',extra=dict(foo='bar')){...,"mdc":{},"extra":{"foo":"bar"},...}By default log messages will include the following fields:{"message":"deleting context b8321b4f-19ff-4c98-b011-5a97178e7ad6","logger":"mdc","timestamp":"2018-03-07T21:39:12.010851","level":"DEBUG","mdc":{"foo":"bar","index":76},"extra":{},"python":{"module":"__init__","function":"MDC","path":"/home/user/git/mdc/mdc/__init__.py","file":"__init__.py","line":56,"process":{"name":"MainProcess","id":31678},"thread":{"name":"MainThread","id":140433289192768}}}Running tests:$tox
Package: mdcat
mdcat - Markdown-friendly variant of catEver struggling quickly documenting your server configuration files in a Git repo or sharing them with your colleagues for the future reference? Welcome tomdcat.It is a simple Python 3 command line utility, ingesting file path(s) arguments, and printing their content in Markdown-friendly format.Moreover, it prints the file's absolute path, mode (permissions), and owner (user + group).RequirementsPython3 + PIPInstallationInstall/upgrade the tool from PyPI using:$ pip3 install --upgrade mdcatUsage$ mdcat --help
Usage: mdcat [OPTIONS] [FILES]...

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.Example:$ echo foo >> bar
$ mdcat barOutput:File: `/home/pavel/mdcat/bar` (`0644 pavel:users`):

    fooContributingPlease readCONTRIBUTING.mdfor details on our code of conduct, and the process for submitting pull requests to us.VersioningWe useSemVerfor versioning. For the versions available, see thetags on this repository.AuthorsPavel Hübner- Initial workLicenseThis project is licensed under theMIT License- see theLICENSEfile for details.
Package: mdchat
MDChatA CLI tool that allows you to chat with your markdown notes. MDChat uses a large language model (LLM) and a method called "Retrieval Augmented Generation" to allow you to have intelligent conversations with an expert on your content.The primary goal of this project is to be both easy to get started with and educational to what modern AI systems can achieve. There are lots of tools like this out there but, in my opinion, they get a bit too into the weeds on the tech or require too much setup.Getting startedTo get started with MDChat you just need to install it, configure it, and get to chattin!pipinstallmdchatThen you can point mdchat at your notes through th interactive config and select a model (GPT-4is more accurate,GPT-3.5-turbois much cheaper and faster)mdchatconfigAfter that's done, all you need to do is start a chat with your notes! You can start a new chat thread with the following command:mdchatchatOr if you want to chat with a specific notemdchatchat--file"/path/to/your/file.md"Key FeaturesAllows you to "chat" with any folder of markdown files or a single markdown file.Answers will include "sources" to the notes used in generating them when possible.summarizing the most recent notes on a certain topic (given your notes are dated)summarizing what you've been working on in the last day, or week (given your notes are dated)Making novel connections on topics you previously hadn't thought were relatedContributingMDChat is open-source and open to contributions! if you're looking to contribute to this project please:Create an issue to discuss your ideaFork this repoCreate a new branch for your changeMake the chnage discussed in your issueSend a pull requestInstalling dependenciespoetrylock
poetryinstallRunning the CLI during developmentpoetryrunmdchat<your-command>Running testspoetryrunpytestLicenseMDChat is released under theMIT License
Package: md-citeproc
md_citeprocThis package is in Alpha. While I'm trying to avoid it, the API might be subject to change.Full Documentation:ReadthedocsPython Markdown extension to render citeproc-style references and citations in Markdown documents. This extension aims to be highly configurable to accommodate a wide variety of use cases, notation styles and bibliographic conventions.FeaturesRender citations based on a CSL style sheet and bibliographic data in CSLJSONAdapt to different notation styles and output stylesOptionally, adjust rendering details by usingJinja templatesRender footnotes and bibliographiesAdd uncited items to the bibliography on renderingArchitectureUnder the hood, this extension uses the Nodejs packageciteproc-clifor the rendering process, which itself is based onciteproc-js.While this architecture limits the portability of the extension, it seems necessary to offer a feature-complete citeproc rendering process. To make things a little easier for a lot of users,pkg-packaged executables for the operating system families Windows, MacOS and Linux on the amd64 platform are shiped with the extension. On these platforms, the extension can run without nodejs or additional configuration. On other platforms, either aciteproc-cliinstallation or apkg-packaged executable ofciteproc-clifor the target platform is necessary to use the extension, the latter can be specified in the configuration of the extension.LinksDocumentationSource CodeIssue Trackerciteproc-cli@npm
Package: mdcleaner
MDCleanerA utility to clean and convert MD files to ASCII.InstallationYou can install MDCleaner via pip:pipinstallmdcleanerUsageAfter installation, you can use the package in your Python scripts:frommdcleanerimportclean_mdcleaned_content=clean_md("path_to_md_file.md")print(cleaned_content)FeaturesEncoding Detection: The utility can automatically detect the file's encoding to ensure compatibility with various text files.ASCII Conversion: Converts non-ASCII characters to their closest ASCII representation using theunidecodelibrary.Template Replacements: Provides an easy way to replace placeholders within the MD files with specific content.Graceful Error Handling: Provides warnings for unmatched templates, ensuring placeholders without corresponding replacements are retained as-is. Additionally, handles improperly formatted templates and gives clear warnings.Using templates in your Markdown fileImagine you have an MD file namedsample.mdwith the following content:This is a test: {my_variable}In your script, you can replace the{my_variable}placeholder with a specific value:frommdcleanerimportclean_mdreplacements={'my_variable':'Hello, World!'}cleaned_content=clean_md("sample.md",contexts=replacements)print(cleaned_content)# This will print: "This is a test: Hello, World!"By passing thecontextsparameter with a dictionary, any placeholders inside{}in your MD file will be replaced by the corresponding values.Encoding DetectionMDCleaner reads a certain number of bytes from the file to determine its encoding:By default, it reads the first 1024 bytes.You can specify a different number of bytes using theencoding_detection_bytesparameter.If you setencoding_detection_bytesto 'auto', the entire file will be read to determine its encoding.If no encoding is specified, the default option used isutf-8.Example:clean_md("sample.md",encoding_detection_bytes=500)Manual EncodingIf you're certain about the encoding of your file, you can specify it directly using theencodingparameter, which bypasses the automatic detection process:clean_md("sample.md",encoding="utf-8")ContributingIf you find any bugs or want to propose a new feature, please open an issue or submit a pull request.LicenseThis project is licensed under the MIT License. See the LICENSE.txt file for details.
Package: md-click
MD ClickMD-Click is a command line tool for creating.mdfiles for any python's click CLI projects.The ProblemAfter creating new CLI project using click, we couldn't found out any tool that generates automatic.mdfiles documentation per each command. This is the reason we've create this quick and easy tool.The SolutionMD-Click creates.mdfiles per each command exists under theclickproject CLI.
The tool runs recursively and generates a markdown file per each command, and sub commands.InstallationJust install it using pip:>pipinstallmd-clickUsageCreate md files per each command, in format ofparent-command, under the--docsPathdirectory.for example, we have the next click python module:# app/cli.pyimportclick@click.group('namer')@click.option('--debug',help='Should I run on Debug?',is_flag=True)defmain(**kwargs):""" A namer CLI """debug=kwargs.get('debug')ifdebug:click.secho('is Debug? True',color='green')@main.command('full')@click.option('--name',help='The user name',required=True,type=str)@click.option('--lastName',help='The last Name',required=False,type=str)deffull_name(**kwargs):""" A CLI that gets name and last name and returns the full name"""firstname=kwargs.get('name')lastname=kwargs.get('lastname')click.secho(f'The full name is:{firstname}{lastname}',color='yellow')and we want to create a nice md files per each command, we'll run the next cli command:>mdclickdumps--baseModule=app.cli--baseCommand=main--docPath=./docs/commandsThe output:./docs/commands/namer.md
./docs/commands/namer-full.mdAs you can assume, all of the markdown files underdocs/commandsin this repository, generated automatically bymdclickcommand.
Use them as a reference.
Package: mdclogpy
MdclogpyStructured logging library with Mapped Diagnostic ContextOutputs the log entries to standard out in structured format, json currently.Severity based filtering.Supports Mapped Diagnostic Context (MDC).
Set MDC pairs are automatically added to log entries by the library.Log entry formatEach log entry written with mdclog_write() function containsTimestampLogger identityLog entry severityAll existing MDC pairsLog message textCurrently the library only supports JSON formatted output written to standard
out of the process.Example log output{"ts": 1603103945651, "crit": "ERROR", "id": "test.py", "mdc": {"PID":101,"SYSTEM_NAME": "Cloud-Space", "HOST_NAME": "master", "SERVICE_NAME": "TestApp", "CONTAINER_NAME": "", "POD_NAME": ""}, "msg": "Hello World!"}InstallInstall from PyPipython3 -m pip install mdclogpyInstall using the sourcepython3 setup.py installUsageThe library can be used in two ways shown below.Use the root loggerimportmdclogpymdclogpy.mdclog_format_init(configmap_monitor=True)mdclogpy.error("This is an error log")Create a logger instancefrommdclogpyimportLoggermy_logger=Logger()my_logger.mdclog_format_init(configmap_monitor=True)my_logger.error("This is an error log")A program can create several logger instances.mdclog_format_init() Adds the MDC log format with HostName, PodName, ContainerName, ServiceName,PID,CallbackNotifyforLogFieldChangePass configmap_monitor = False in mdclog_format_init() function to stop dynamic log level change based on configmap.Mapped Diagnostics ContextThe MDCs are logger instance specific key-value pairs, which are included to
all log entries written via the logger instance.By default, the library implements a root logger instance.
MDCs added to the root logger instance are added only to the log entries
written via the root logger instance.LicenseCopyright (c) 2019 AT&T Intellectual Property.
Copyright (c) 2018-2019 Nokia.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.This source code is part of the near-RT RIC (RAN Intelligent Controller)
platform project (RICP).Unit testingTo run the unit tests run the following command in the package directory::python3 -m unittest discoverCIThe ci is done with thetoxtool. Seetox.inifile for details.