Skip to content

Commit fc0967d

Browse files
committed
update
1 parent 3975f9f commit fc0967d

File tree

9 files changed

+297
-0
lines changed

9 files changed

+297
-0
lines changed

TMX_urls.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Oct 12 06:21:14 2019
4+
5+
@author: rayde
6+
"""
7+
8+
class tmx_urls:
9+
def __init__(self):
10+
pass
11+
12+
def bysymbol(self, symbol):
13+
url = "https://api.tmxmoney.com/qmapi/getCompanyBySymbol.json?symbol=" + symbol
14+
return url
15+
16+
def bysector(self, sector_code):
17+
url = "https://api.tmxmoney.com/qmapi/getGlobalIndustrySectorPeers.json?sector="+ sector_code + "&country=CA&limit=1500&resultsPerPage=250"]
18+
return url
19+
20+
def quotes(self, symbols):
21+
url = "https://api.tmxmoney.com/qmapi/getQuotes.json?symbols="+ symbols + "&country=CA&limit=1500&resultsPerPage=250"
22+
return url

exdividend.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Wed Oct 9 20:02:35 2019
4+
5+
@author: rayde
6+
"""
7+
8+
9+
if __name__ == '__main__':
10+
year = '2019'
11+
month = '10'
12+
day = list(range(31))
13+
october = dividend_calendar()
14+
for each in day:
15+
try:
16+
dictionary = october.scraper(year, month, str(each))
17+
october.calendar(dictionary)
18+
except:
19+
pass
20+
october.calendars
21+
pandas.concat(october.calendars)

headers.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Wed Oct 9 20:26:44 2019
4+
5+
@author: rayde
6+
"""
7+
8+
class headers:
9+
def __init__(self):
10+
pass
11+
12+
def calendar(self):
13+
hdrs = {'Accept': 'application/json, text/plain, */*',
14+
'DNT': 1,
15+
'Origin': 'https://www.nasdaq.com',
16+
'Referer': 'https://www.nasdaq.com/market-activity/dividends?date=2019-Oct-09',
17+
'Sec-Fetch-Mode': 'cors',
18+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36'}
19+
return hdrs
20+
21+
def quote(self):
22+
symbol = self.symbol
23+
hdrs = {'Accept': 'application/json, text/plain, */*',
24+
'DNT': 1,
25+
'Origin': 'https://www.nasdaq.com',
26+
'Referer': 'https://www.nasdaq.com/market-activity/dividends?date=2019-Oct-09',
27+
'Sec-Fetch-Mode': 'cors',
28+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36'}
29+
return hdrs

logo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
#The Power of Computer Programming
3+
4+
print("Technology | Global Equity | Female Empowerment")
5+
6+
for each in "Technology | Global Equity | Female Empowerment":
7+
print(each)

marijuana_analysis.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Tue Sep 24 14:31:25 2019
4+
5+
@author: rayde
6+
"""
7+
from finance_python import stock
8+
import requests, pandas, lxml
9+
from bs4 import BeautifulSoup as soup
10+
from urllib.request import urlopen
11+
from lxml import html
12+
13+
class mj(stock):
14+
def __init__(self, weed_stocks, links):
15+
self.attributes = [ ]
16+
self.stocks = list(zip(weed_stocks, links))
17+
#self.soup = soup()
18+
19+
def __general__(self, url):
20+
Client=urlopen(url)
21+
xml_page=Client.read()
22+
Client.close()
23+
soup_page=soup(xml_page,"xml")
24+
return soup_page
25+
26+
def __table__(self, url):
27+
page = requests.get(url)
28+
tree = html.fromstring(page.content)
29+
table = tree.xpath('//table')
30+
table = list(map(lambda x: pandas.read_html(lxml.etree.tostring(table[x], method='xml'))[0], range(0,len(table))))
31+
return table
32+
33+
def sales_growth(self):
34+
sales_growth = []
35+
return sales_growth
36+
37+
def production_costs(self):
38+
cost_of_production = []
39+
return cost_of_production
40+
41+
def cost_sold(self):
42+
cost_of_goods_sold = []
43+
return cost_of_goods_sold
44+
45+
def soup(self):
46+
soup_page = list(map(lambda x: self.__general__(x[1]), self.stocks))
47+
return soup_page
48+
49+
def items(self, soup_page):
50+
item_list = soup_page.find_all('item')
51+
return item_list
52+
53+
def links(self, soup_page):
54+
links_list = soup_page.find_all('link')
55+
return links_list
56+
57+
def titles(self, soup_page):
58+
titles = soup_page.find_all('title')
59+
return titles
60+
61+
def description(self, soup_page):
62+
descriptions = soup_page.find_all('description')
63+
return descriptions
64+
65+
def subject(self, soup_page):
66+
subject = soup_page.find_all('subject')
67+
return subject
68+
69+
if __name__ == '__main__':
70+
weed_stocks = ['CRON.TO', 'FIRE.TO', 'ACB.TO',
71+
'VFF.TO', 'APHA.TO', 'WEED.TO', 'TGOD.TO']
72+
73+
links = ['https://www.globenewswire.com/RssFeed/Organization/n40N3EwqUdtaSsRfodARTg==',
74+
'https://www.prnewswire.com/news-releases/supreme-cannabis-announces-q4-and-2019-fiscal-year-end-financial-results-300920109.html',
75+
"https://www.prnewswire.com/news-releases/aurora-cannabis-announces-financial-results-for-the-fourth-quarter-and-2019-fiscal-year-300916447.html",
76+
'https://www.globenewswire.com/RssFeed/Organization/JDHyurLpImZNh2UX9_Ud2g==',
77+
'https://www.globenewswire.com/RssFeed/Organization/R1h25zYnVjsHP2c9g1rymw==',
78+
'https://www.prnewswire.com/news-releases/canopy-growth-drives-revenue-with-94-increase-in-recreational-dried-cannabis-sales-in-first-quarter-of-fiscal-2020-300901964.html',
79+
'https://www.globenewswire.com/RssFeed/Organization/hp_wl2JXUNsysLV7iSAl9A==']
80+
81+
acb_data = [{'rev_change':.61}, {'revenue':94.6}, {'production_cost': 1.14},
82+
{'volume': 29034}, {'volume_chg': .86}, {'gross margin': .58},
83+
{'medical patients': 89700}]
84+
85+
cgc_data = [{'rev_change': -.038}, {'revenue':90.5}, {'production_cost': },
86+
{'volume': 10,549 }, {'volume_chg': .13 }, {'gross margin': .43 }]

mergepdf.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sun Sep 22 16:50:41 2019
4+
5+
@author: rayde
6+
"""
7+
8+
#geektechstuff
9+
#Python script to merge multiple PDF files into one PDF
10+
11+
#Requires the “PyPDF2” and “OS” modules to be imported
12+
import os, PyPDF2
13+
14+
#Ask user where the PDFs are
15+
userpdflocation= Downloads
16+
17+
#Sets the scripts working directory to the location of the PDFs
18+
os.chdir(userpdflocation)
19+
20+
#Ask user for the name to save the file as
21+
userfilename=input(‘What should I call the file?’)
22+
23+
#Get all the PDF filenames
24+
pdf2merge = []
25+
for filename in os.listdir(‘.’):
26+
if filename.endswith(‘.pdf’):
27+
pdf2merge.append(filename)
28+
29+
pdfWriter = PyPDF2.PdfFileWriter()
30+
31+
#loop through all PDFs
32+
for filename in pdf2merge:
33+
#rb for read binary
34+
pdfFileObj = open(filename,’rb’)
35+
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
36+
#Opening each page of the PDF
37+
for pageNum in range(pdfReader.numPages):
38+
pageObj = pdfReader.getPage(pageNum)
39+
pdfWriter.addPage(pageObj)
40+
#save PDF to file, wb for write binary
41+
pdfOutput = open(userfilename+’.pdf’, ‘wb’)
42+
#Outputting the PDF
43+
pdfWriter.write(pdfOutput)
44+
#Closing the PDF writer
45+
pdfOutput.close()
46+

new_logo.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
@author: Código Ecuador
4+
@website: www.CodigoEcuador.com
5+
@contact: info@codigoecuador.com
6+
"""
7+
class Global_Equity:
8+
def __init__(self):
9+
self.tecnología = "tecnología"
10+
self.equidad_global = "tecnología"
11+
self.empoderamiento_femenino = "tecnología"
12+
self.libertad = "tecnología"
13+
14+
def empoderamiento_femenino(self):
15+
'''El poder de la programación de computadoras'''
16+
17+
print("tecnología = equidad_global = empoderamiento_femenino = libertad")
18+
19+
tecnología = "tecnología"
20+
equidad_global = "tecnología"
21+
empoderamiento_femenino = "tecnología"
22+
libertad = "tecnología"
23+
24+
tecnología = [equidad_global,
25+
empoderamiento_femenino,
26+
libertad]
27+
28+
return empoderamiento_femenino
29+
30+
31+
def libertad(self):
32+
'''El poder de la programación de computadoras'''
33+
34+
print("tecnología = equidad_global = empoderamiento_femenino = libertad")
35+
36+
tecnología = "tecnología"
37+
equidad_global = "tecnología"
38+
empoderamiento_femenino = "tecnología"
39+
libertad = "tecnología"
40+
41+
tecnología = equidad_global = empoderamiento_femenino = libertad
42+
return libertad
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+

parser.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Mon Sep 30 05:56:26 2019
4+
5+
@author: rayde
6+
"""
7+
8+
9+
from html.parser import HTMLParser
10+
11+
class MyHTMLParser(HTMLParser):
12+
def handle_starttag(self, tag, attrs):
13+
print("Encountered a start tag:", tag)
14+
15+
def handle_endtag(self, tag):
16+
print("Encountered an end tag :", tag)
17+
18+
def handle_data(self, data):
19+
print("Encountered some data :", data)
20+
21+
parser = MyHTMLParser()
22+
parser.feed('<html><head><title>Test</title></head>'
23+
'<body><h1>Parse me!</h1></body></html>')

update_pypi.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Tue Oct 1 14:10:49 2019
4+
5+
@author: rayde
6+
"""
7+
8+
python setup.py sdist
9+
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
10+
11+
twine upload dist/*

0 commit comments

Comments
 (0)