Where should I post my python code?

Today I needed to parse some data from an xlsx file (Office open XML Spreadsheet). I could just open the files in openoffice and export to csv. However, I will need reimport data from this table later, and I would like to exclude manual operation.

I searched the net for xlsx parsing, and all I found was a stack question with the same question: Analyzing and creating Microsoft Office 2007 files (.docx, .xlsx,. PPTX)

So, I rode on my own.

These are 134 lines of code for parsing and accessing a spreadsheet and 54 lines of code for unit tests. This, of course, is checked only for 1 file that I need, and in addition to how it is used in unit tests, there is currently no documentation. It uses zipfile, minidom, re and unittest, therefore it is completely portable and platform independent.

Since I don't blog, and I have no desire to turn this into a python library for OfficeOpen XML, I got stuck wondering where I should post this code. I solved the problem that I am sure others will receive in the future. So I want to publish my code under the public domain somewhere, so that someone will copy and paste into their application and configure to fix their problem.

The implementation is simple, and here is a quick overview of the features:

workbook = Workbook(filename) # open a file for sheet in workbook: pass # iterate over the worksheets workbook["sheetname"] # access a sheet by name, also possible to do by index from 0 sheet["A1"] # Access cell sheet["A"] # Access column sheet["1"] # Access row cell.value # Cell value - only tested with ints and strings. 

Thanks for all the answers. I was about to post it on activation, but the page continued to crash when sending activation mail to me. Therefore, I cannot activate my code in order to publish it.

My second choice was codeproject, and I wrote a good article about the file. Unfortunately, this page crashes when I try to submit my post.

So, I put it on github to view and fork: http://github.com/staale/python-xlsx/tree/master

I don't want to do all the work for hosting a python project, so.

Accepting git answer as this is the only thing that worked for me. And git stones.

Edit: Gah, I lost the whole post in codeproject, and I made such a good record. Screw it, I spent more time trying to share this than it took to code it. Therefore, I urge this to be done for myself, as it is now. If I do not decide to configure it later.

+4
source share
7 answers

GitHub will also be a great place to post this post. Moreover, this will allow others to quickly smash their own copies and make any improvements or modifications that they need. These changes will then be available to anyone who wants them.

+5
source

You must publish it here . There are many recipes here, and yours will fit perfectly.

The stack overflow should be a wiki where people search for questions and find answers. However, if you want to publish it here, what you will do is a question related to your answer, and then answer your question with your answer.

+5
source

If your code is short enough to copy and paste, you can submit it as a Python recipe . This site is a great resource for learning Python techniques, and its best content has been compiled into a book .

If your code can be reused somehow, you should publish your Python code in the Python Package Index (pypi). Organize your source code; read this tutorial on how to write setup.py for your package. Once you have a free pypi account and wrote setup.py , run python setup.py register to get your package name and publish its metadata to the index. setup.py can also upload your source or package binaries for pypi, for example python setup.py sdist upload will build and load s ource dist .

Once your package is included in the Python package index, other Python programmers can download and install it automatically using a number of tools, including easy_install your_package .

+2
source

err, with a more descriptive name, I'm sure many people would find it here themselves. (but I did not know about this tag is a non-question).

Therefore, you can get a free blog and just put in the bit you want to share, so you will also have a permanent online link when you need it.

+1
source

All in all, CodeProject is a great place to publish code if you are ready to write a short article on code. (One of the good things about CodeProject is that they require some code formulation). The site receives a huge amount of traffic, so everything that you publish there will be visible.

+1
source

It seems to me that the Python Package Index is the right place for you

0
source

Can I humbly offer my site; http://utilitymill.com . It allows you to not only publish your code in Python, but also turn it into a running web utility.

Users can exchange codes and lists, and even provides you with a free RESTful API for a free utility.

0
source

All Articles