Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7ff8e28

Browse filesBrowse files
committed
Make the package installable with PIP
Add setup.py Convert README.md to README.rst
1 parent ecf9a06 commit 7ff8e28
Copy full SHA for 7ff8e28

File tree

Expand file treeCollapse file tree

3 files changed

+80
-34
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+80
-34
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
-34Lines changed: 0 additions & 34 deletions
This file was deleted.

‎README.rst

Copy file name to clipboard
+41Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
StackOverflow Importer
2+
======================
3+
4+
Do you ever feel like all you’re doing is copy/pasting from Stack
5+
Overflow?
6+
7+
Let’s take it one step further.
8+
9+
| ``from stackoverflow import quick_sort`` will go through the search
10+
results
11+
| of ``[python] quick sort`` looking for the largest code block that
12+
doesn’t
13+
| syntax error in the highest voted answer from the highest voted
14+
question
15+
| and return it as a module. If that answer doesn’t have any valid
16+
python
17+
| code, it checks the next highest voted answer for code blocks.
18+
19+
.. code:: python
20+
21+
>>> from stackoverflow import quick_sort, split_into_chunks
22+
23+
>>> print(quick_sort.sort([1, 3, 2, 5, 4]))
24+
[1, 2, 3, 4, 5]
25+
>>> print(list(split_into_chunks.chunk("very good chunk func")))
26+
['very ', 'good ', 'chunk', ' func']
27+
>>> print("gotta take a break")
28+
gotta take a break
29+
>>> from time import time
30+
>>> t1 = time()
31+
>>> from stackoverflow import time_delay
32+
>>> print("that's enough, let's continue coding", time() - t1)
33+
that's enough, let's continue coding 5.7283220291137695
34+
>>> print("I wonder who made split_into_chunks", split_into_chunks.__author__)
35+
I wonder who made split_into_chunks https://stackoverflow.com/a/35107113
36+
>>> print("but what's the license? Can I really use this?", quick_sort.__license__)
37+
but what's the license? Can I really use this? CC BY-SA 3.0
38+
>>> assert("nice, attribution!")
39+
40+
This module is PSF-licensed as it uses multiple lines of code from the
41+
python standard library.

‎setup.py

Copy file name to clipboard
+39Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""A setuptools based setup module.
2+
3+
See:
4+
https://packaging.python.org/en/latest/distributing.html
5+
https://github.com/pypa/sampleproject
6+
"""
7+
8+
from setuptools import setup
9+
from codecs import open
10+
from os import path
11+
12+
here = path.abspath(path.dirname(__file__))
13+
14+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
15+
long_description = f.read()
16+
17+
setup(
18+
name='stackoverflow',
19+
version='0.1.0',
20+
description='A sample Python project',
21+
long_description=long_description,
22+
url='https://github.com/drathier/stack-overflow-import',
23+
author='https://github.com/drathier',
24+
author_email='fille.haglund@hotmail.com',
25+
license='PSFL',
26+
classifiers=[
27+
'Development Status :: 3 - Alpha',
28+
'Intended Audience :: Developers',
29+
'Topic :: Software Development :: Build Tools',
30+
'License :: OSI Approved :: Python Software Foundation License',
31+
'Programming Language :: Python :: 3',
32+
'Programming Language :: Python :: 3.3',
33+
'Programming Language :: Python :: 3.4',
34+
'Programming Language :: Python :: 3.5',
35+
],
36+
keywords='stackoverflow development boilerplate',
37+
packages=["stackoverflow"],
38+
install_requires=['requests'],
39+
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.