There are already some info programs out there. Some even written in python (archey) is one i know of. screenfetch i think is a universal distro one. If you want to make your own just open them up and see how they they obtain the info.
metulburr@ubuntu:~$ screenfetch
./+o+- metulburr@ubuntu
yyyyy- -yyyyyy+ OS: Ubuntu 16.04 xenial
://+//////-yyyyyyo Kernel: x86_64 Linux 4.4.0-142-generic
.++ .:/++++++/-.+sss/` Uptime: 1d 1h 23m
.:++o: /++++++++/:--:/- Packages: 2892
o:+o+:++.`..```.-/oo+++++/ Shell: bash 4.3.48
.:+o:+o/. `+sssoo+/ Resolution: 3840x1093
.++/+:+oo+o:` /sssooo. DE: Unity 7.4.5
/+++//+:`oo+o /::--:. WM: Compiz
\+/+o+++`o++o ++////. WM Theme: Ambiance
.++.o+++oo+:` /dddhhh. GTK Theme: Ambiance [GTK2/3]
.+.o+oo:. `oddhhhh+ Icon Theme: ubuntu-mono-dark
\+.++o+o``-````.:ohdhhhhh+ Font: Ubuntu 11
`:o+++ `ohhhhhhhhyo++os: CPU: Intel Core i7-2600 CPU @ 3.8GHz
.o:`.syhhhhhhh/.oo++o` RAM: 5896MiB / 13941MiB
/osyyyyyyo++ooo+++/
````` +oo+++o\:
`oo++.
metulburr@ubuntu:~$ archey
.oyhhs: User: metulburr
..--.., shhhhhh- Hostname: ubuntu
-+++++++++`:yyhhyo` OS: Ubuntu 16.04 x86_64
.-- -++++++++/-.-::-` Kernel: 4.4.0-142-generic
.::::- :-----:/+++/++/. Uptime: 1 day, 1:23
-:::::-. .:++++++: Window Manager: Compiz
,,, .:::::-` .++++++- Shell: Bash
./+++/-`-::- ./////: Terminal: Xterm-256color
+++++++ .::- Packages: 2892
./+++/-`-::- :yyyyyo CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
``` `-::::-` :yhhhhh: RAM: -10319 MB / 13941 MB
-:::::-. `-ohhhhhh+ Disk: 4.3T / 4.6T
.::::-` -o+///+oyhhyyyhy:
`.-- /yhhhhhhhy+,....
/hhhhhhhhh-.-:::;
`.:://::- -:::::;
`.-:-'
im pretty sure archey just parses out linux info files such as
metulburr@ubuntu:~$ cat /proc/cpuinfo | grep model
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
model : 42
model name : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
or for parsing for RAM
$ free -m
total used free shared buff/cache available
Mem: 13941 5158 1053 819 7729 7591
Swap: 14245 0 14245