{"id":13937099,"url":"https://github.com/brianray/mm","last_synced_at":"2025-12-14T19:04:47.538Z","repository":{"id":1923700,"uuid":"2851816","full_name":"brianray/mm","owner":"brianray","description":"Python powered spreadsheets","archived":false,"fork":false,"pushed_at":"2018-08-14T17:04:19.000Z","size":1638,"stargazers_count":173,"open_issues_count":8,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-08T23:26:18.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianray.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-25T19:44:35.000Z","updated_at":"2024-06-30T16:20:02.000Z","dependencies_parsed_at":"2022-06-25T18:39:33.272Z","dependency_job_id":null,"html_url":"https://github.com/brianray/mm","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianray%2Fmm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianray%2Fmm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianray%2Fmm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianray%2Fmm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianray","download_url":"https://codeload.github.com/brianray/mm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226693903,"owners_count":17667757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T23:03:17.598Z","updated_at":"2025-12-14T19:04:47.464Z","avatar_url":"https://github.com/brianray.png","language":"Python","readme":"Marmir is powerful and fun\n==========================\n\n[Marmir](http://brianray.github.com/mm/) takes Python data structures and turns them into spreadsheets.\n\nIt is xlwt and google spreadsheets on steroids. \n\nIt also supports: input from Django models; taking Psycopg cursors; writing out ascii tables (like psql does); and will soon support HTML tables as output. The goal is to make it easy to generate many types of useful table files with the least amount of configuration.\n\n## Marmir melts in your mouth\n\nInstalling:\n\n```\n$ pip install Marmir\n```\n\nTalk about simple to use, wow. Marmir is just this:\n\n``` python\n\nimport datetime\nimport mm\n\nnow = datetime.datetime.now().replace(microsecond=0)\n\nmy_data = [ \n    {\n        'msg': \"My first Row\",\n        'id': 1,\n        'when': now,\n    },\n    {\n        'msg': \"My second Row\",\n        'id': 2,\n        'when': now,\n    },\n\n]\n\nmm_doc = mm.Document(my_data)\nmm_doc.write(\"example.xls\")\n```\nSame example above as lists (also node the 'order' argument works in the above as well:\n```python\nmy_headers = ('id', 'msg', 'when')\nmy_data = (\n    (1, \"My First Row\", now),\n    (2, \"My Second Row\", now)   \n)\n\nmm_doc = mm.Document(my_data, order=my_headers)\nmm_doc.write(\"example.xls\")\n```\nOr you can get fancier:\n\n``` python\nimport datetime\nimport mm\n\nmy_data = [ \n    {\n        'msg': \"My first Row\",\n        'id': 1,\n        'when': mm.Date(datetime.datetime.now(), \"%Y-%m-%dT%H:%M:%S\"),\n        'homepage': mm.URL(\"https://github.com/brianray\")\n    },\n    {\n        'msg': \"My second Row\",\n        'id': 2,\n        'when': datetime.datetime.now(),\n        'homepage': mm.URL(\"http://twitter.com/brianray\", \"Tweet Me\")\n    },\n\n]\n\nmm_doc = mm.Document(my_data)\nmm_doc.write(\"example.xls\")\n\n# also you can publish to google spreadsheats\nmm_doc.write_gdata(\"Example Spreadsheet\", \"Username\", \"Pass\")\n```\n\nNow for a little Django (https://www.djangoproject.com/) example:\n\n``` python\n\nfrom yourproject.models import TestModel\nfrom mm.contrib.django.data_model import DjangoDataModel\nfrom mm.contrib.django.grid import DjangoGrid\n\ndjango_query_set = TestModel.objects.all()\nmm_doc = mm.Document(django_query_set, \n              data_model_class=DjangoDataModel, \n              grid_class=DjangoGrid)\nmm_doc.write(\"django_example.xls\")\n```\n\nThere is a lot more. Check out the [Examples](https://github.com/brianray/mm/blob/master/EXAMPLES.markdown).\n\n## ... Not in your hand\n\nSo the primary goals are:\n\n * make XLS spreadsheets better than xlwt\n * Create Spreadsheets in Google Docs\n * convert python types automagically, date is a date, int is a int, string is a string, ...\n * do stuff you expect like make columns wider to fit, wrap in some cases\n * make stuff pretty colors and easier to read\n * generate directly from Django queries\n\nSome other stuff:\n\n * do summaries and break out tables\n * add logic and math functions \n \n## Marmir is written with love\n\nBrian Ray [@brianray](http://twitter.com/brianray) wrote Marmir. Brian: is the organizer of ChiPy\n(http://chipy.org); one of Chicago's Top Tech 25 (according to Crains Oct\n2011); been professionally developing software for business for 15 years; and\nis sick of sub-par Python libraries for creating business spreadsheets.\n\nThe name Marmir name from parts of the names Maura and Miranda, the author's girls.\n\n\nCopyright\n---------\n\nCopyright (c) 2013 Brian Ray\n\n","funding_links":[],"categories":["Specific Formats Processing","资源列表","Python","Text Processing","Awesome Python"],"sub_categories":["特殊文本格式处理","Specific Formats Processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianray%2Fmm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianray%2Fmm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianray%2Fmm/lists"}